Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBasketHasNoItems = errors.Wrap(errors.ErrBadRequest, "the basket has no items") ErrBasketCannotBeModified = errors.Wrap(errors.ErrBadRequest, "the basket cannot be modified") ErrBasketCannotBeCancelled = errors.Wrap(errors.ErrBadRequest, "the basket cannot be cancelled") ErrQuantityCannotBeNegative = errors.Wrap(errors.ErrBadRequest, "the item quantity cannot be negative") ErrBasketIDCannotBeBlank = errors.Wrap(errors.ErrBadRequest, "the basket id cannot be blank") ErrPaymentIDCannotBeBlank = errors.Wrap(errors.ErrBadRequest, "the payment id cannot be blank") ErrCustomerIDCannotBeBlank = errors.Wrap(errors.ErrBadRequest, "the customer id cannot be blank") )
Functions ¶
This section is empty.
Types ¶
type Basket ¶
type Basket struct {
ddd.AggregateBase
CustomerID string
PaymentID string
Items []Item
Status BasketStatus
}
func StartBasket ¶
func (Basket) IsCancellable ¶
type BasketCanceled ¶
type BasketCanceled struct {
Basket *Basket
}
func (BasketCanceled) EventName ¶
func (BasketCanceled) EventName() string
type BasketCheckedOut ¶
type BasketCheckedOut struct {
Basket *Basket
}
func (BasketCheckedOut) EventName ¶
func (BasketCheckedOut) EventName() string
type BasketItemAdded ¶
func (BasketItemAdded) EventName ¶
func (BasketItemAdded) EventName() string
type BasketItemRemoved ¶
func (BasketItemRemoved) EventName ¶
func (BasketItemRemoved) EventName() string
type BasketRepository ¶
type BasketStarted ¶
type BasketStarted struct {
Basket *Basket
}
func (BasketStarted) EventName ¶
func (BasketStarted) EventName() string
type BasketStatus ¶
type BasketStatus string
const ( BasketUnknown BasketStatus = "" BasketIsOpen BasketStatus = "open" BasketIsCanceled BasketStatus = "canceled" BasketIsCheckedOut BasketStatus = "checked_out" )
func ToBasketStatus ¶
func ToBasketStatus(status string) BasketStatus
func (BasketStatus) String ¶
func (s BasketStatus) String() string
type OrderRepository ¶
type ProductRepository ¶
Click to show internal directories.
Click to hide internal directories.