inventory

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")

	ErrInvalidCategoryId   = errors.New("invalid category id")
	ErrInvalidCategoryName = errors.New("invalid category name")
	ErrCategoryNotEmpty    = errors.New("category is not empty")

	ErrInvalidItemId     = errors.New("invalid item id")
	ErrInvalidItemName   = errors.New("invalid item name")
	ErrInvalidItemPrice  = errors.New("invalid item price")
	ErrInvalidItemOrigin = errors.New("invalid item origin")
)

Functions

This section is empty.

Types

type CategoryRepository

type CategoryRepository interface {
	SaveCategory(ctx context.Context, cat *models.Category) (*models.Category, error)
	GetCategoryByID(ctx context.Context, categoryId uuid.UUID) (*models.Category, error)
	GetCategoryByName(ctx context.Context, categoryName string) (*models.Category, error)
	FetchAllCategories(ctx context.Context) ([]*models.Category, error)
	DeleteCategory(ctx context.Context, categoryId uuid.UUID) (*models.Category, error)
}

type InventoryService

type InventoryService interface {
	CreateCategory(ctx context.Context, cat *models.Category) (*models.Category, error)
	UpdateCategory(ctx context.Context, cat *models.Category) (*models.Category, error)
	GetCategoryByID(ctx context.Context, categoryId uuid.UUID) (*models.Category, error)
	GetCategoryByName(ctx context.Context, categoryName string) (*models.Category, error)
	FetchAllCategories(ctx context.Context) ([]*models.Category, error)
	DeleteCategory(ctx context.Context, categoryId uuid.UUID) (*models.Category, error)

	CreateItem(ctx context.Context, i *models.InventoryItem) (*models.InventoryItem, error)
	UpdateItem(ctx context.Context, i *models.InventoryItem) (*models.InventoryItem, error)
	GetItemByID(ctx context.Context, itemId uuid.UUID) (*models.InventoryItem, error)
	GetItemsByCategoryID(ctx context.Context, categoryId uuid.UUID) ([]*models.InventoryItem, error)
	FetchAllItems(ctx context.Context) ([]*models.InventoryItem, error)
	DeleteItem(ctx context.Context, itemId uuid.UUID) (*models.InventoryItem, error)
}

type ItemRepository

type ItemRepository interface {
	SaveItem(ctx context.Context, i *models.InventoryItem) (*models.InventoryItem, error)
	GetItemByID(ctx context.Context, itemId uuid.UUID) (*models.InventoryItem, error)
	GetItemsByCategoryID(ctx context.Context, categoryId uuid.UUID) ([]*models.InventoryItem, error)
	FetchAllItems(ctx context.Context) ([]*models.InventoryItem, error)
	DeleteItem(ctx context.Context, itemId uuid.UUID) (*models.InventoryItem, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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