command

package
v0.0.0-...-0c44e78 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHandler

type CommandHandler[C any] interface {
	Handle(ctx context.Context, cmd C) error
}

type CreateCategory

type CreateCategory struct {
	Name        string
	Description string
}

type CreateCategoryHandler

type CreateCategoryHandler CommandHandler[CreateCategory]

func NewCreateCategoryHandler

func NewCreateCategoryHandler(sf sonyflake.IDGenerator, logger logger.Logger, categoryRepo domain.CategoryRepository) CreateCategoryHandler

type CreateProduct

type CreateProduct struct {
	Name        string
	BrandName   string
	Description string
	Price       uint64
	CategoryID  uint64
	Inventory   uint64
}

type CreateProductHandler

type CreateProductHandler CommandHandler[CreateProduct]

func NewCreateProductHandler

func NewCreateProductHandler(sf sonyflake.IDGenerator, logger logger.Logger, productRepo domain.ProductRepository) CreateProductHandler

type PurchaseProduct

type PurchaseProduct struct {
	ID       uint64
	Quantity uint64
}

type PurchasedProduct

type PurchasedProduct struct {
	ID       uint64
	Quantity uint64
}

type RollbackProductInventory

type RollbackProductInventory struct {
	IdempotencyKey    uint64
	PurchasedProducts *[]PurchasedProduct
}

type RollbackProductInventoryHandler

type RollbackProductInventoryHandler CommandHandler[RollbackProductInventory]

func NewRollbackProductInventoryHandler

func NewRollbackProductInventoryHandler(logger logger.Logger, productRepo domain.ProductRepository) RollbackProductInventoryHandler

type UpdateProductDetail

type UpdateProductDetail struct {
	ProductID   uint64
	Name        string
	BrandName   string
	Description string
	Price       uint64
}

type UpdateProductDetailHandler

type UpdateProductDetailHandler CommandHandler[UpdateProductDetail]

func NewUpdateProductDetailHandler

func NewUpdateProductDetailHandler(logger logger.Logger, productRepo domain.ProductRepository) UpdateProductDetailHandler

type UpdateProductInventory

type UpdateProductInventory struct {
	IdempotencyKey    uint64
	PurchasedProducts *[]PurchasedProduct
}

type UpdateProductInventoryHandler

type UpdateProductInventoryHandler CommandHandler[UpdateProductInventory]

func NewUpdateProductInventoryHandler

func NewUpdateProductInventoryHandler(logger logger.Logger, productRepo domain.ProductRepository) UpdateProductInventoryHandler

Jump to

Keyboard shortcuts

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