application

package
v0.0.0-...-a69a74b Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCartApp

func NewCartApp(cartRepo repository.CartRepositoryI, itemApp ItemAppInterface, vasItemApp VasItemAppInterface, promotionApp PromotionAppInterface) *cartApp

func NewCategoryApp

func NewCategoryApp(categoryRepo repository.CategoryRepositoryI) *categoryApp

func NewItemApp

func NewItemApp(itemRepo repository.ItemRepositoryI) *itemApp

func NewPromotionApp

func NewPromotionApp(promotionRepo repository.PromotionRepositoryI) *promotionApp

func NewVasItemApp

func NewVasItemApp(vir repository.VasItemRepositoryI, iti ItemAppInterface) *vasItemApp

Types

type CartAppInterface

type CartAppInterface interface {
	ApplyPromotion(cartId int, promotionId int) (*entity.Cart, error)
	Display(cartId int) (*dto.DisplayCartDTO, error)
	ResetCart(cartId int) (*entity.Cart, error)
	AddItem(cartId int, item *entity.Item) (*entity.Cart, error)
	UpdateCartPriceAndQuantity(cart *entity.Cart) (*entity.Cart, error)
	AddVasItem(vasItem *entity.VasItem) (*entity.Cart, error)
	RemoveItem(itemId int) (*entity.Cart, error)
	RemoveVasItem(vasItemId int) (*entity.Cart, error)
}

type CategoryAppInterface

type CategoryAppInterface interface {
	List() ([]*entity.Category, error)
	Create(category *entity.Category) (*entity.Category, error)
	GetByID(id int) (*entity.Category, error)
}

type ItemAppInterface

type ItemAppInterface interface {
	ListByCartId(int) ([]*entity.Item, error)
	Create(*entity.Item) (*entity.Item, error)
	Update(*entity.Item) (*entity.Item, error)
	GetById(int) (*entity.Item, error)
	Delete(int) error
}

type PromotionAppInterface

type PromotionAppInterface interface {
	List() ([]*entity.Promotion, error)
	Create(*entity.Promotion) (*entity.Promotion, error)
	GetById(int) (*entity.Promotion, error)
}

type VasItemAppInterface

type VasItemAppInterface interface {
	ListByItemId(int) ([]*entity.VasItem, error)
	GetById(int) (*entity.VasItem, error)
	Create(*entity.VasItem) (*entity.VasItem, error)
	DeleteById(int) error
}

Jump to

Keyboard shortcuts

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