infrastructure

package
v0.0.0-...-7756f97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 NewCheckoutRepository(cart *cart.Client, catalog *catalog.Client, rabbitmq *rabbitmq.AMQP, logger *zap.Logger, tp telemetry.Provider) *CheckoutRepository

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

func (r *CheckoutRepository) SendConfirmation(ctx context.Context, cart *models.Cart) error

func (*CheckoutRepository) ShipOrder

func (r *CheckoutRepository) ShipOrder(ctx context.Context) error

Directories

Path Synopsis
clients

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL