package value_objects import ( "time" ) type ExpirationDate struct { value time.Time } func NewExpirationDate(value time.Time) (ExpirationDate, error) { // According to business rules, expired items can be added to the store, // so we don't need to validate if the date is in the past return ExpirationDate{value: value}, nil } func (e ExpirationDate) Time() time.Time { return e.value } func (e ExpirationDate) String() string { return e.value.Format(time.RFC3339) }