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 {
ID string
CustomerID string
PaymentID string
Items []Item
Status BasketStatus
}
func StartBasket ¶
func (Basket) IsCancellable ¶
type BasketRepository ¶
type BasketStatus ¶
type BasketStatus string
const ( BasketUnknown BasketStatus = "" BasketOpen BasketStatus = "open" BasketCancelled BasketStatus = "cancelled" BasketCheckedOut BasketStatus = "checked_out" )
func (BasketStatus) String ¶
func (s BasketStatus) String() string
type OrderRepository ¶
type ProductRepository ¶
Click to show internal directories.
Click to hide internal directories.