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) }
Click to show internal directories.
Click to hide internal directories.