init
This commit is contained in:
@@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"apskel-pos-be/internal/entities"
|
||||
"apskel-pos-be/internal/mappers"
|
||||
"apskel-pos-be/internal/models"
|
||||
"apskel-pos-be/internal/repository"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
@@ -22,35 +22,14 @@ type InventoryProcessor interface {
|
||||
GetZeroStockItems(ctx context.Context, outletID uuid.UUID) ([]models.InventoryResponse, error)
|
||||
}
|
||||
|
||||
type InventoryRepository interface {
|
||||
Create(ctx context.Context, inventory *entities.Inventory) error
|
||||
GetByID(ctx context.Context, id uuid.UUID) (*entities.Inventory, error)
|
||||
GetWithRelations(ctx context.Context, id uuid.UUID) (*entities.Inventory, error)
|
||||
GetByProductAndOutlet(ctx context.Context, productID, outletID uuid.UUID) (*entities.Inventory, error)
|
||||
GetByOutlet(ctx context.Context, outletID uuid.UUID) ([]*entities.Inventory, error)
|
||||
GetByProduct(ctx context.Context, productID uuid.UUID) ([]*entities.Inventory, error)
|
||||
GetLowStock(ctx context.Context, outletID uuid.UUID) ([]*entities.Inventory, error)
|
||||
GetZeroStock(ctx context.Context, outletID uuid.UUID) ([]*entities.Inventory, error)
|
||||
Update(ctx context.Context, inventory *entities.Inventory) error
|
||||
Delete(ctx context.Context, id uuid.UUID) error
|
||||
List(ctx context.Context, filters map[string]interface{}, limit, offset int) ([]*entities.Inventory, int64, error)
|
||||
Count(ctx context.Context, filters map[string]interface{}) (int64, error)
|
||||
AdjustQuantity(ctx context.Context, productID, outletID uuid.UUID, delta int) (*entities.Inventory, error)
|
||||
SetQuantity(ctx context.Context, productID, outletID uuid.UUID, quantity int) (*entities.Inventory, error)
|
||||
UpdateReorderLevel(ctx context.Context, id uuid.UUID, reorderLevel int) error
|
||||
BulkCreate(ctx context.Context, inventoryItems []*entities.Inventory) error
|
||||
BulkAdjustQuantity(ctx context.Context, adjustments map[uuid.UUID]int, outletID uuid.UUID) error
|
||||
GetTotalValueByOutlet(ctx context.Context, outletID uuid.UUID) (float64, error)
|
||||
}
|
||||
|
||||
type InventoryProcessorImpl struct {
|
||||
inventoryRepo InventoryRepository
|
||||
inventoryRepo repository.InventoryRepository
|
||||
productRepo ProductRepository
|
||||
outletRepo OutletRepository
|
||||
}
|
||||
|
||||
func NewInventoryProcessorImpl(
|
||||
inventoryRepo InventoryRepository,
|
||||
inventoryRepo repository.InventoryRepository,
|
||||
productRepo ProductRepository,
|
||||
outletRepo OutletRepository,
|
||||
) *InventoryProcessorImpl {
|
||||
|
||||
Reference in New Issue
Block a user