Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created August 31, 2021 06:11
Show Gist options
  • Save percybolmer/3f9af204019e852be5332672323d645c to your computer and use it in GitHub Desktop.
Save percybolmer/3f9af204019e852be5332672323d645c to your computer and use it in GitHub Desktop.
// AddCustomer will add a new customer and return the customerID
func (o *OrderService) AddCustomer(name string) (uuid.UUID, error) {
c, err := customer.NewCustomer(name)
if err != nil {
return uuid.Nil, err
}
// Add to Repo
err = o.customers.Add(c)
if err != nil {
return uuid.Nil, err
}
return c.GetID(), nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment