Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active September 4, 2021 18:39
Show Gist options
  • Save percybolmer/33fba95f31522641fd7b40254b23309c to your computer and use it in GitHub Desktop.
Save percybolmer/33fba95f31522641fd7b40254b23309c to your computer and use it in GitHub Desktop.
#ddd-tavern
// GetID returns the customers root entity ID
func (c *Customer) GetID() uuid.UUID {
return c.person.ID
}
// SetID sets the root ID
func (c *Customer) SetID(id uuid.UUID) {
if c.person == nil {
c.person = &entity.Person{}
}
c.person.ID = id
}
// SetName changes the name of the Customer
func (c *Customer) SetName(name string) {
if c.person == nil {
c.person = &entity.Person{}
}
c.person.Name = name
}
// SetName changes the name of the Customer
func (c *Customer) GetName() string {
return c.person.Name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment