package entities import "time" // DETAIL PRODUK type StockTransferDetail struct { Id uint64 `gorm:"primaryKey;autoIncrement"` StockTransferId uint64 ProductId uint64 // === FIFO FIELDS - SOURCE WAREHOUSE (Usable) === // Tracking stock yang DIAMBIL dari source warehouse SourceProductWarehouseID *uint64 `gorm:"column:source_product_warehouse_id"` UsageQty float64 `gorm:"column:usage_qty;default:0"` // Actual yang berhasil diambil PendingQty float64 `gorm:"column:pending_qty;default:0"` // Yang pending (nunggu stock) // === FIFO FIELDS - DESTINATION WAREHOUSE (Stockable) === // Tracking stock yang DITAMBAHKAN ke destination warehouse DestProductWarehouseID *uint64 `gorm:"column:dest_product_warehouse_id"` TotalQty float64 `gorm:"column:total_qty;default:0"` // Total lot yang tersedia TotalUsed float64 `gorm:"column:total_used;default:0"` // Yang sudah dipakai dari lot ini // === METADATA === CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `gorm:"index"` // === RELATIONS === StockTransfer *StockTransfer `gorm:"foreignKey:StockTransferId"` Product *Product `gorm:"foreignKey:ProductId"` SourceProductWarehouse *ProductWarehouse `gorm:"foreignKey:SourceProductWarehouseID"` DestProductWarehouse *ProductWarehouse `gorm:"foreignKey:DestProductWarehouseID"` DeliveryItems []StockTransferDeliveryItem `gorm:"foreignKey:StockTransferDetailId"` }