Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProductNameIsBlank = errors.Wrap(errors.ErrBadRequest, "the product name cannot be blank") ErrProductPriceIsNegative = errors.Wrap(errors.ErrBadRequest, "the product price cannot be negative") )
View Source
var ( ErrStoreNameIsBlank = errors.Wrap(errors.ErrBadRequest, "the store name cannot be blank") ErrStoreLocationIsBlank = errors.Wrap(errors.ErrBadRequest, "the store location cannot be blank") ErrStoreIsAlreadyParticipating = errors.Wrap(errors.ErrBadRequest, "the store is already participating") ErrStoreIsAlreadyNotParticipating = errors.Wrap(errors.ErrBadRequest, "the store is already not participating") )
Functions ¶
This section is empty.
Types ¶
type Product ¶
type Product struct {
ddd.AggregateBase
StoreID string
Name string
Description string
SKU string
Price float64
}
func CreateProduct ¶
type ProductAdded ¶
type ProductAdded struct {
Product *Product
}
func (ProductAdded) EventName ¶
func (ProductAdded) EventName() string
type ProductRemoved ¶
type ProductRemoved struct {
Product *Product
}
func (ProductRemoved) EventName ¶
func (ProductRemoved) EventName() string
type ProductRepository ¶
type Store ¶
type Store struct {
ddd.AggregateBase
Name string
Location string
Participating bool
}
func CreateStore ¶
func (*Store) DisableParticipation ¶
func (*Store) EnableParticipation ¶
type StoreCreated ¶
type StoreCreated struct {
Store *Store
}
func (StoreCreated) EventName ¶
func (StoreCreated) EventName() string
type StoreParticipationDisabled ¶
type StoreParticipationDisabled struct {
Store *Store
}
func (StoreParticipationDisabled) EventName ¶
func (StoreParticipationDisabled) EventName() string
type StoreParticipationEnabled ¶
type StoreParticipationEnabled struct {
Store *Store
}
func (StoreParticipationEnabled) EventName ¶
func (StoreParticipationEnabled) EventName() string
type StoreRepository ¶
Click to show internal directories.
Click to hide internal directories.