mirror of
https://github.com/foomo/shop.git
synced 2025-10-16 12:35:39 +00:00
move Person VO to fix code generation
This commit is contained in:
parent
e26e15ae66
commit
e46ec90f50
@ -99,3 +99,28 @@ func (address *Address) TrimSpace() {
|
||||
address.Country = strings.TrimSpace(address.Country)
|
||||
address.CountryCode = strings.TrimSpace(address.CountryCode)
|
||||
}
|
||||
|
||||
// Person is a field Customer and of Address
|
||||
// Only Customer->Person has Contacts
|
||||
type Person struct {
|
||||
FirstName string
|
||||
MiddleName string
|
||||
LastName string
|
||||
Title TitleType
|
||||
Salutation SalutationType
|
||||
Birthday string
|
||||
Contacts map[string]*Contact // key must be contactID
|
||||
DefaultContacts map[ContactType]string // reference by contactID
|
||||
}
|
||||
|
||||
func (person *Person) TrimSpace() {
|
||||
if person == nil {
|
||||
return
|
||||
}
|
||||
person.FirstName = strings.TrimSpace(person.FirstName)
|
||||
person.MiddleName = strings.TrimSpace(person.MiddleName)
|
||||
person.LastName = strings.TrimSpace(person.LastName)
|
||||
person.Title = TitleType(strings.TrimSpace(string(person.Title)))
|
||||
person.Salutation = SalutationType(strings.TrimSpace(string(person.Salutation)))
|
||||
person.Birthday = strings.TrimSpace(person.Birthday)
|
||||
}
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
package address
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Person is a field Customer and of Address
|
||||
// Only Customer->Person has Contacts
|
||||
type Person struct {
|
||||
FirstName string
|
||||
MiddleName string
|
||||
LastName string
|
||||
Title TitleType
|
||||
Salutation SalutationType
|
||||
Birthday string
|
||||
Contacts map[string]*Contact // key must be contactID
|
||||
DefaultContacts map[ContactType]string // reference by contactID
|
||||
}
|
||||
|
||||
func (person *Person) TrimSpace() {
|
||||
if person == nil {
|
||||
return
|
||||
}
|
||||
person.FirstName = strings.TrimSpace(person.FirstName)
|
||||
person.MiddleName = strings.TrimSpace(person.MiddleName)
|
||||
person.LastName = strings.TrimSpace(person.LastName)
|
||||
person.Title = TitleType(strings.TrimSpace(string(person.Title)))
|
||||
person.Salutation = SalutationType(strings.TrimSpace(string(person.Salutation)))
|
||||
person.Birthday = strings.TrimSpace(person.Birthday)
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user