material_manage_system/internal/model/inventory.go
2026-09-16 16:29:04 +08:00

33 lines
1.2 KiB
Go

package model
import (
"time"
"github.com/shopspring/decimal"
)
// InventoryBalance is the inventory-domain quantity for one storage dimension.
type InventoryBalance struct {
ID int64 `json:"id"`
OrganizationID int64 `json:"organization_id"`
WarehouseID int64 `json:"warehouse_id"`
LocationID int64 `json:"location_id"`
MaterialID int64 `json:"material_id"`
OnHand decimal.Decimal `json:"on_hand"`
Reserved decimal.Decimal `json:"reserved"`
Locked decimal.Decimal `json:"locked"`
InTransit decimal.Decimal `json:"in_transit"`
Version int `json:"version"`
UpdatedAt time.Time `json:"updated_at"`
}
// StockWarningRule stores an inventory threshold independently of material master data.
type StockWarningRule struct {
ID int64 `json:"id"`
OrganizationID int64 `json:"organization_id"`
WarehouseID int64 `json:"warehouse_id"`
MaterialID int64 `json:"material_id"`
MinimumAvailable decimal.Decimal `json:"minimum_available"`
Enabled bool `json:"enabled"`
}