Skip to content

Commit

Permalink
replace RealEstateObject.IBAN and BIC with BankAccounts
Browse files Browse the repository at this point in the history
  • Loading branch information
ungerik committed Oct 23, 2024
1 parent 88b2fde commit 1cda269
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions golang/domonda/realestateobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ type RealEstateObject struct {
ZipCode nullable.TrimmedString
City nullable.TrimmedString
Country country.Code
IBAN bank.NullableIBAN
BIC bank.NullableBIC
BankAccounts []bank.Account
Active bool
}

Expand All @@ -53,11 +52,10 @@ func (o *RealEstateObject) Validate() error {
if o.Country, err = o.Country.NormalizedWithAltCodes(); err != nil {
errs = append(errs, fmt.Errorf("RealEstateObject.Country: %w", err))
}
if o.IBAN, err = o.IBAN.Normalized(); err != nil {
errs = append(errs, fmt.Errorf("RealEstateObject.IBAN: %w", err))
}
if o.BIC, err = o.BIC.Normalized(); err != nil {
errs = append(errs, fmt.Errorf("RealEstateObject.BIC: %w", err))
for i := range o.BankAccounts {
if err = o.BankAccounts[i].Validate(); err != nil {
errs = append(errs, fmt.Errorf("RealEstateObject.BankAccounts[%d]: %w", i, err))
}
}
return errors.Join(errs...)
}
Expand Down

0 comments on commit 1cda269

Please sign in to comment.