Documentation ¶
Index ¶
- Constants
- Variables
- type Bot
- type BotStatus
- type FakeProductCacheRepository
- func (r *FakeProductCacheRepository) Add(ctx context.Context, productID, storeID, name string) error
- func (r *FakeProductCacheRepository) Find(ctx context.Context, productID string) (*Product, error)
- func (r *FakeProductCacheRepository) Rebrand(ctx context.Context, productID, name string) error
- func (r *FakeProductCacheRepository) Remove(ctx context.Context, productID string) error
- func (r *FakeProductCacheRepository) Reset(products ...*Product)
- type FakeStoreCacheRepository
- func (r *FakeStoreCacheRepository) Add(ctx context.Context, storeID, name, location string) error
- func (r *FakeStoreCacheRepository) Find(ctx context.Context, storeID string) (*Store, error)
- func (r *FakeStoreCacheRepository) Rename(ctx context.Context, storeID, name string) error
- func (r *FakeStoreCacheRepository) Reset(stores ...*Store)
- type Item
- type Items
- type MockOrderRepository
- type MockProductCacheRepository
- func (_m *MockProductCacheRepository) Add(ctx context.Context, productID string, storeID string, name string) error
- func (_m *MockProductCacheRepository) Find(ctx context.Context, productID string) (*Product, error)
- func (_m *MockProductCacheRepository) Rebrand(ctx context.Context, productID string, name string) error
- func (_m *MockProductCacheRepository) Remove(ctx context.Context, productID string) error
- type MockProductRepository
- type MockShoppingListRepository
- type MockStoreCacheRepository
- func (_m *MockStoreCacheRepository) Add(ctx context.Context, storeID string, name string, location string) error
- func (_m *MockStoreCacheRepository) Find(ctx context.Context, storeID string) (*Store, error)
- func (_m *MockStoreCacheRepository) Rename(ctx context.Context, storeID string, name string) error
- type MockStoreRepository
- type OrderRepository
- type Product
- type ProductCacheRepository
- type ProductRepository
- type ShoppingList
- type ShoppingListAssigned
- type ShoppingListCanceled
- type ShoppingListCompleted
- type ShoppingListCreated
- type ShoppingListInitiated
- type ShoppingListRepository
- type ShoppingListStatus
- type Stop
- type Stops
- type Store
- type StoreCacheRepository
- type StoreRepository
Constants ¶
const ( ShoppingListCreatedEvent = "depot.ShoppingListCreated" ShoppingListCanceledEvent = "depot.ShoppingListCanceled" ShoppingListInitiatedEvent = "depot.ShoppingListInitiated" ShoppingListAssignedEvent = "depot.ShoppingListAssigned" ShoppingListCompletedEvent = "depot.ShoppingListCompleted" )
const ShoppingListAggregate = "depot.ShoppingList"
Variables ¶
var ( ErrShoppingCannotBeCanceled = errors.Wrap(errors.ErrBadRequest, "the shopping list cannot be canceled") ErrShoppingCannotBeInitiated = errors.Wrap(errors.ErrBadRequest, "the shopping list cannot be initiated") ErrShoppingCannotBeAssigned = errors.Wrap(errors.ErrBadRequest, "the shopping list cannot be assigned") ErrShoppingCannotBeCompleted = errors.Wrap(errors.ErrBadRequest, "the shopping list cannot be completed") )
Functions ¶
This section is empty.
Types ¶
type FakeProductCacheRepository ¶
type FakeProductCacheRepository struct {
// contains filtered or unexported fields
}
func NewFakeProductCacheRepository ¶
func NewFakeProductCacheRepository() *FakeProductCacheRepository
func (*FakeProductCacheRepository) Add ¶
func (r *FakeProductCacheRepository) Add(ctx context.Context, productID, storeID, name string) error
func (*FakeProductCacheRepository) Rebrand ¶
func (r *FakeProductCacheRepository) Rebrand(ctx context.Context, productID, name string) error
func (*FakeProductCacheRepository) Remove ¶
func (r *FakeProductCacheRepository) Remove(ctx context.Context, productID string) error
func (*FakeProductCacheRepository) Reset ¶
func (r *FakeProductCacheRepository) Reset(products ...*Product)
type FakeStoreCacheRepository ¶
type FakeStoreCacheRepository struct {
// contains filtered or unexported fields
}
func NewFakeStoreCacheRepository ¶
func NewFakeStoreCacheRepository() *FakeStoreCacheRepository
func (*FakeStoreCacheRepository) Add ¶
func (r *FakeStoreCacheRepository) Add(ctx context.Context, storeID, name, location string) error
func (*FakeStoreCacheRepository) Rename ¶
func (r *FakeStoreCacheRepository) Rename(ctx context.Context, storeID, name string) error
func (*FakeStoreCacheRepository) Reset ¶
func (r *FakeStoreCacheRepository) Reset(stores ...*Store)
type MockOrderRepository ¶
MockOrderRepository is an autogenerated mock type for the OrderRepository type
func NewMockOrderRepository ¶
func NewMockOrderRepository(t mockConstructorTestingTNewMockOrderRepository) *MockOrderRepository
NewMockOrderRepository creates a new instance of MockOrderRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type MockProductCacheRepository ¶
MockProductCacheRepository is an autogenerated mock type for the ProductCacheRepository type
func NewMockProductCacheRepository ¶
func NewMockProductCacheRepository(t mockConstructorTestingTNewMockProductCacheRepository) *MockProductCacheRepository
NewMockProductCacheRepository creates a new instance of MockProductCacheRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockProductCacheRepository) Add ¶
func (_m *MockProductCacheRepository) Add(ctx context.Context, productID string, storeID string, name string) error
Add provides a mock function with given fields: ctx, productID, storeID, name
func (*MockProductCacheRepository) Find ¶
Find provides a mock function with given fields: ctx, productID
type MockProductRepository ¶
MockProductRepository is an autogenerated mock type for the ProductRepository type
func NewMockProductRepository ¶
func NewMockProductRepository(t mockConstructorTestingTNewMockProductRepository) *MockProductRepository
NewMockProductRepository creates a new instance of MockProductRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type MockShoppingListRepository ¶
MockShoppingListRepository is an autogenerated mock type for the ShoppingListRepository type
func NewMockShoppingListRepository ¶
func NewMockShoppingListRepository(t mockConstructorTestingTNewMockShoppingListRepository) *MockShoppingListRepository
NewMockShoppingListRepository creates a new instance of MockShoppingListRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockShoppingListRepository) Find ¶
func (_m *MockShoppingListRepository) Find(ctx context.Context, shoppingListID string) (*ShoppingList, error)
Find provides a mock function with given fields: ctx, shoppingListID
func (*MockShoppingListRepository) Save ¶
func (_m *MockShoppingListRepository) Save(ctx context.Context, list *ShoppingList) error
Save provides a mock function with given fields: ctx, list
func (*MockShoppingListRepository) Update ¶
func (_m *MockShoppingListRepository) Update(ctx context.Context, list *ShoppingList) error
Update provides a mock function with given fields: ctx, list
type MockStoreCacheRepository ¶
MockStoreCacheRepository is an autogenerated mock type for the StoreCacheRepository type
func NewMockStoreCacheRepository ¶
func NewMockStoreCacheRepository(t mockConstructorTestingTNewMockStoreCacheRepository) *MockStoreCacheRepository
NewMockStoreCacheRepository creates a new instance of MockStoreCacheRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockStoreCacheRepository) Add ¶
func (_m *MockStoreCacheRepository) Add(ctx context.Context, storeID string, name string, location string) error
Add provides a mock function with given fields: ctx, storeID, name, location
type MockStoreRepository ¶
MockStoreRepository is an autogenerated mock type for the StoreRepository type
func NewMockStoreRepository ¶
func NewMockStoreRepository(t mockConstructorTestingTNewMockStoreRepository) *MockStoreRepository
NewMockStoreRepository creates a new instance of MockStoreRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type OrderRepository ¶
type ProductCacheRepository ¶
type ProductRepository ¶
type ShoppingList ¶
type ShoppingList struct { ddd.Aggregate OrderID string Stops Stops AssignedBotID string Status ShoppingListStatus }
func CreateShoppingList ¶
func CreateShoppingList(id, orderID string) *ShoppingList
func NewShoppingList ¶
func NewShoppingList(id string) *ShoppingList
func (*ShoppingList) AddItem ¶
func (sl *ShoppingList) AddItem(store *Store, product *Product, quantity int) error
func (*ShoppingList) Assign ¶
func (sl *ShoppingList) Assign(id string) error
func (*ShoppingList) Cancel ¶
func (sl *ShoppingList) Cancel() error
func (*ShoppingList) Complete ¶
func (sl *ShoppingList) Complete() error
func (*ShoppingList) Initiate ¶
func (sl *ShoppingList) Initiate() error
func (ShoppingList) Key ¶
func (ShoppingList) Key() string
type ShoppingListAssigned ¶
type ShoppingListAssigned struct { ShoppingList *ShoppingList BotID string }
func (ShoppingListAssigned) Key ¶
func (ShoppingListAssigned) Key() string
type ShoppingListCanceled ¶
type ShoppingListCanceled struct {
ShoppingList *ShoppingList
}
func (ShoppingListCanceled) Key ¶
func (ShoppingListCanceled) Key() string
type ShoppingListCompleted ¶
type ShoppingListCompleted struct {
ShoppingList *ShoppingList
}
func (ShoppingListCompleted) Key ¶
func (ShoppingListCompleted) Key() string
type ShoppingListCreated ¶
type ShoppingListCreated struct {
ShoppingList *ShoppingList
}
func (ShoppingListCreated) Key ¶
func (ShoppingListCreated) Key() string
type ShoppingListInitiated ¶
type ShoppingListInitiated struct {
ShoppingList *ShoppingList
}
func (ShoppingListInitiated) Key ¶
func (ShoppingListInitiated) Key() string
type ShoppingListRepository ¶
type ShoppingListRepository interface { Find(ctx context.Context, shoppingListID string) (*ShoppingList, error) Save(ctx context.Context, list *ShoppingList) error Update(ctx context.Context, list *ShoppingList) error }
type ShoppingListStatus ¶
type ShoppingListStatus string
const ( ShoppingListUnknown ShoppingListStatus = "" ShoppingListIsPending ShoppingListStatus = "pending" ShoppingListIsAvailable ShoppingListStatus = "available" ShoppingListIsAssigned ShoppingListStatus = "assigned" ShoppingListIsActive ShoppingListStatus = "active" ShoppingListIsCompleted ShoppingListStatus = "completed" ShoppingListIsCanceled ShoppingListStatus = "canceled" )
func ToShoppingListStatus ¶
func ToShoppingListStatus(status string) ShoppingListStatus
func (ShoppingListStatus) String ¶
func (s ShoppingListStatus) String() string
type StoreCacheRepository ¶
Source Files ¶
- bot.go
- bot_status.go
- fake_product_cache_repository.go
- fake_store_cache_repository.go
- item.go
- mock_order_repository.go
- mock_product_cache_repository.go
- mock_product_repository.go
- mock_shopping_list_repository.go
- mock_store_cache_repository.go
- mock_store_repository.go
- order_repository.go
- product.go
- product_cache_repository.go
- product_repository.go
- shopping_list.go
- shopping_list_events.go
- shopping_list_repository.go
- shopping_list_status.go
- stop.go
- store.go
- store_cache_repository.go
- store_repository.go