Documentation ¶
Index ¶
- Constants
- Variables
- type CheckoutRepository
- func (r *CheckoutRepository) ChargeCard(ctx context.Context, amount float64) error
- func (r *CheckoutRepository) GetShippingCost(ctx context.Context) (float64, error)
- func (r *CheckoutRepository) PlaceOrder(ctx context.Context, cartId int64) error
- func (r *CheckoutRepository) SendConfirmation(ctx context.Context, cart *models.Cart) error
- func (r *CheckoutRepository) ShipOrder(ctx context.Context) error
Constants ¶
View Source
const (
InventoryUpdateRk = "order.placed"
)
Variables ¶
View Source
var ( CartNotFound = errors.New("cart not found") ProductNotFound = errors.New("product not found") InsufficientInventory = errors.New("insufficient inventory") ShippingCostCalculationFailed = errors.New("shipping cost calculation failed") CardDeclined = errors.New("card declined") ShippingLabelNotIssued = errors.New("shipping label not issued") InventoryUpdateFailure = errors.New("failed to update inventory") )
Functions ¶
This section is empty.
Types ¶
type CheckoutRepository ¶
type CheckoutRepository struct {
// contains filtered or unexported fields
}
func NewCheckoutRepository ¶
func (*CheckoutRepository) ChargeCard ¶
func (r *CheckoutRepository) ChargeCard(ctx context.Context, amount float64) error
func (*CheckoutRepository) GetShippingCost ¶
func (r *CheckoutRepository) GetShippingCost(ctx context.Context) (float64, error)
func (*CheckoutRepository) PlaceOrder ¶
func (r *CheckoutRepository) PlaceOrder(ctx context.Context, cartId int64) error
func (*CheckoutRepository) SendConfirmation ¶
Click to show internal directories.
Click to hide internal directories.