25 lines
709 B
Go
25 lines
709 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type StockMovement struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
|
|
ProductID uint `json:"product_id"`
|
|
Product Product `gorm:"foreignKey:ProductID" json:"product"`
|
|
|
|
OriginWarehouseID uint `json:"origin_warehouse_id"`
|
|
OriginWarehouse Warehouse `gorm:"foreignKey:OriginWarehouseID" json:"origin_warehouse"`
|
|
|
|
StockType string `json:"stock_type"` // contoh: "in", "out", "transfer"
|
|
|
|
DestinationWarehouseID *uint `json:"destination_warehouse_id"`
|
|
DestinationWarehouse *Warehouse `gorm:"foreignKey:DestinationWarehouseID" json:"destination_warehouse"`
|
|
|
|
Date time.Time `json:"date"`
|
|
Note string `json:"note"`
|
|
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|