Skip to content

Instantly share code, notes, and snippets.

@italolelis
Last active January 18, 2019 14:07
Show Gist options
  • Save italolelis/15ec1a53a8c814697b6ce3f592167b2a to your computer and use it in GitHub Desktop.
Save italolelis/15ec1a53a8c814697b6ce3f592167b2a to your computer and use it in GitHub Desktop.
Order repository definition
// WriteRepository represents the write operations for an order
type WriteRepository interface {
Add(context.Context, *Order) error
Remove(context.Context, uuid.UUID) error
}
// ReadRepository represents the read operations for an order
type ReadRepository interface {
FindOneByID(context.Context, uuid.UUID) (*Order, error)
}
// Service is the interface that provides coffee methods.
type Service interface {
CreateOrder(ctx context.Context, name string, items Items) (uuid.UUID, error)
RequestOrder(ctx context.Context, orderID string) (*Order, error)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment