package entities type ProductWarehouse struct { Id uint `gorm:"primaryKey;column:id"` ProductId uint `gorm:"column:product_id;not null"` WarehouseId uint `gorm:"column:warehouse_id;not null"` ProjectFlockKandangId *uint `gorm:"column:project_flock_kandang_id"` Quantity float64 `gorm:"column:qty;type:numeric(15,3);default:0"` // Relations Product Product `gorm:"foreignKey:ProductId;references:Id"` Warehouse Warehouse `gorm:"foreignKey:WarehouseId;references:Id"` ProjectFlockKandang *ProjectFlockKandang `gorm:"foreignKey:ProjectFlockKandangId;references:Id"` StockLogs []StockLog `gorm:"foreignKey:ProductWarehouseId;references:Id"` }