repo

package
v0.0.0-...-aec1c34 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Paginate

func Paginate(page, pageSize int) func(db *gorm.DB) *gorm.DB

Types

type InventoryRepository

type InventoryRepository interface {
	CreateMerchant(ctx context.Context, merchantName string, adminID uint) (uuid.UUID, error)
	ListMerchant(ctx context.Context) (merchants []model.Merchant, err error)
	ListMerchantByIDs(ctx context.Context, mids []uuid.UUID) ([]model.Merchant, error)

	CreateProduct(ctx context.Context, name, desc string, mid uuid.UUID, qty int, price float32) (uuid.UUID, error)
	ListProduct(ctx context.Context, qp *dto.BasicQueryParam) ([]model.Product, error)
	ListProductByIDs(ctx context.Context, pids []uuid.UUID, qp *dto.BasicQueryParam) ([]model.Product, error)
	ReserveProduct(ctx context.Context, oid, pid uuid.UUID, qty int) (payble float32, err error)
	RemoveReservedProduct(ctx context.Context, oid uuid.UUID) error
	UndoReserveProduct(ctx context.Context, oid uuid.UUID) error
}

InventoryRepository defines all the DB operations that the service supports

func NewBasicOrderRepo

func NewBasicOrderRepo(db *gorm.DB) InventoryRepository

Jump to

Keyboard shortcuts

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