mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
d1b377ddac
- Build stock transfer API with nested details, deliveries, and items - Extend DB schema for stock transfers - Implement validation for transfer request and stock - Prepare/implement transfer audit log structure - Preload all relations for complete response - Update DTOs for nested response - Remove redundant root fields, use relation objects
24 lines
786 B
Go
24 lines
786 B
Go
package entities
|
|
|
|
import "time"
|
|
|
|
// HEADER
|
|
type StockTransfer struct {
|
|
Id uint64 `gorm:"primaryKey;autoIncrement"`
|
|
MovementNumber string `gorm:"uniqueIndex;not null"`
|
|
FromWarehouseId uint64
|
|
ToWarehouseId uint64
|
|
TransferDate time.Time
|
|
Reason string
|
|
CreatedBy uint64
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
DeletedAt *time.Time `gorm:"index"`
|
|
// Relations
|
|
FromWarehouse *Warehouse `gorm:"foreignKey:FromWarehouseId"`
|
|
ToWarehouse *Warehouse `gorm:"foreignKey:ToWarehouseId"`
|
|
Details []StockTransferDetail `gorm:"foreignKey:StockTransferId"`
|
|
Deliveries []StockTransferDelivery `gorm:"foreignKey:StockTransferId"`
|
|
CreatedUser *User `gorm:"foreignKey:CreatedBy"`
|
|
}
|