Documentation ¶
Index ¶
- func NewOrderFromDatabase(orderAdapter OrderAdapter) (domain.Order, error)
- type OrderAdapter
- type OrderLineAdapter
- type OrderRepository
- func (o OrderRepository) BookProductFromInventory(ctx context.Context, id vo.ID, quantity domain.OrderLineQuantity) (vo.ID, error)
- func (o OrderRepository) Delete(ctx context.Context, id vo.ID) error
- func (o OrderRepository) Save(ctx context.Context, order domain.Order) error
- func (o OrderRepository) Search(ctx context.Context, id vo.ID) (domain.Order, error)
- func (o OrderRepository) SearchByClient(ctx context.Context, clientID vo.ID) (domain.Order, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOrderFromDatabase ¶
func NewOrderFromDatabase(orderAdapter OrderAdapter) (domain.Order, error)
Types ¶
type OrderAdapter ¶
type OrderAdapter struct { ID primitive.ObjectID `bson:"_id"` ClientID primitive.ObjectID `bson:"client_id"` AddressShipping string `bson:"address_shipping"` State string `bson:"state"` Taxes float64 `bson:"taxes"` Subtotal float64 `bson:"subtotal"` Total float64 `bson:"total"` OrderLines []OrderLineAdapter `bson:"order_lines"` }
func NewOrderAdapter ¶
func NewOrderAdapter(order domain.Order) OrderAdapter
func (*OrderAdapter) CompleteOrderLines ¶
func (o *OrderAdapter) CompleteOrderLines(orderLines []domain.OrderLine)
type OrderLineAdapter ¶
type OrderRepository ¶
type OrderRepository struct { *mongoatlas.MongoClient // contains filtered or unexported fields }
func NewOrderRepository ¶
func NewOrderRepository(client *mongoatlas.MongoClient) OrderRepository
func (OrderRepository) BookProductFromInventory ¶
func (o OrderRepository) BookProductFromInventory(ctx context.Context, id vo.ID, quantity domain.OrderLineQuantity) (vo.ID, error)
func (OrderRepository) SearchByClient ¶
Click to show internal directories.
Click to hide internal directories.