Skip to content

Commit

Permalink
sync: commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ispiroglu committed Apr 23, 2024
1 parent 653f8b3 commit 7ebcef1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (b *BuildingAggregate) CreateBuildingCommandHandler(cmd *CreateBuildingComm
return ErrBuildingAreaValueIsInvalid
}

if strings.EqualFold(cmd.Area.Unit, "sqm") {
if !strings.EqualFold(cmd.Area.Unit, "sqm") {
return ErrBuildingAreaUnitIsInvalid
}

Expand Down
20 changes: 9 additions & 11 deletions internal/domain/building/core/vo/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ package vo
import "fmt"

type Address struct {
Country string `json:"country"`
Region string `json:"region"`
Province string `json:"province"`
District string `json:"district"`
PostalCode string `json:"postalCode"`
Country string `json:"country"`
Region string `json:"region"`
Province string `json:"province"`
District string `json:"district"`
}

func NewAddress(country, region, province, district, postalCode string) *Address {
return &Address{
Country: country,
Region: region,
Province: province,
District: district,
PostalCode: postalCode,
Country: country,
Region: region,
Province: province,
District: district,
}
}

func (a *Address) String() string {
return fmt.Sprintf("%s, %s, %s, %s, %s", a.Country, a.Region, a.Province, a.District, a.PostalCode)
return fmt.Sprintf("%s, %s, %s, %s", a.Country, a.Region, a.Province, a.District)
}
1 change: 1 addition & 0 deletions internal/server/request/CreateBuildingRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
)

type CreateBuildingRequest struct {
Name string `json:"name"`
Address vo.Address `json:"address"`
Area model.Measurement `json:"area"`
}

0 comments on commit 7ebcef1

Please sign in to comment.