sales

package
v0.0.0-...-9123e61 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidParameter = errors.New("invalid parameter")

	ErrInvalidBasketId  = errors.New("invalid parameter")
	ErrInvalidItemCount = errors.New("invalid item count")
	ErrBasketNotOpen    = errors.New("basket not open")
	ErrNotItemInBasket  = errors.New("there is no item in basket")

	ErrInvalidReceiptId = errors.New("invalid receipt id")
)

Functions

This section is empty.

Types

type BasketRepository

type BasketRepository interface {
	SaveBasket(ctx context.Context, basket *models.Basket) (*models.Basket, error)
	GetBasketByID(ctx context.Context, basketId uuid.UUID) (*models.Basket, error)
	FetchAllBaskets(ctx context.Context) ([]*models.Basket, error)
}

type ReceiptRepository

type ReceiptRepository interface {
	SaveReceipt(ctx context.Context, receipt *models.Receipt) (*models.Receipt, error)
	GetReceiptByID(ctx context.Context, receiptId uuid.UUID) (*models.Receipt, error)
	FetchAllReceipts(ctx context.Context) ([]*models.Receipt, error)
}

type SalesService

type SalesService interface {
	CreateBasket(ctx context.Context) (uuid.UUID, error)
	GetBasketByID(ctx context.Context, basketId uuid.UUID) (*models.Basket, error)
	AddItem(ctx context.Context, basketId uuid.UUID, itemId uuid.UUID, itemCount int) error
	RemoveItem(ctx context.Context, basketId uuid.UUID, itemId uuid.UUID, itemCount int) error
	CancelBasket(ctx context.Context, basketId uuid.UUID) error
	CloseBasket(ctx context.Context, basketId uuid.UUID) (*models.Receipt, error)
	GetReceiptByID(ctx context.Context, receiptId uuid.UUID) (*models.Receipt, error)
	FetchAllReceipts(ctx context.Context) ([]*models.Receipt, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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