biz

package
v0.0.0-...-657e486 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type CartRepo

type CartRepo interface {
	GetCart(ctx context.Context, userId string) (cart.Cart, error)
	EmptyCart(ctx context.Context, userId string) error
}

type CartUseCase

type CartUseCase struct {
	// contains filtered or unexported fields
}

func NewCartUseCase

func NewCartUseCase(repo CartRepo, logger log.Logger) *CartUseCase

func (*CartUseCase) EmptyCart

func (cu *CartUseCase) EmptyCart(ctx context.Context, id string) error

func (*CartUseCase) GetCart

func (cu *CartUseCase) GetCart(ctx context.Context, id string) (cart.Cart, error)

type CatalogRepo

type CatalogRepo interface {
	GetProduct(ctx context.Context, productId string) (product.Product, error)
}

type CatalogUseCase

type CatalogUseCase struct {
	// contains filtered or unexported fields
}

func NewCatalogUseCase

func NewCatalogUseCase(repo CatalogRepo, logger log.Logger) *CatalogUseCase

func (*CatalogUseCase) GetProduct

func (cu *CatalogUseCase) GetProduct(ctx context.Context, id string) (product.Product, error)

type CheckoutUseCase

type CheckoutUseCase struct {
	// contains filtered or unexported fields
}

func NewCheckoutUseCase

func NewCheckoutUseCase(cuc *CartUseCase, cluc *CatalogUseCase, uuc *UserUseCase, logger log.Logger) *CheckoutUseCase

func (*CheckoutUseCase) PlaceOrder

func (cu *CheckoutUseCase) PlaceOrder(ctx context.Context, userId string) (res order.OrderResult, err error)

type UserRepo

type UserRepo interface {
	Get(ctx context.Context, userId string) (*user.User, error)
}

type UserUseCase

type UserUseCase struct {
	// contains filtered or unexported fields
}

func NewUserUseCase

func NewUserUseCase(repo UserRepo, logger log.Logger) *UserUseCase

func (*UserUseCase) Get

func (uc *UserUseCase) Get(ctx context.Context, id string) (*user.User, error)

Jump to

Keyboard shortcuts

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