feat(BE): add standard_fcr column to production_standard_details and update related services and validations

This commit is contained in:
aguhh18
2025-12-30 10:27:12 +07:00
parent db4e8232b9
commit e4acd9a21e
7 changed files with 35 additions and 10 deletions
@@ -0,0 +1,3 @@
-- Remove standard_fcr column from production_standard_details table
ALTER TABLE production_standard_details
DROP COLUMN IF EXISTS standard_fcr;
@@ -0,0 +1,3 @@
-- Add standard_fcr column to production_standard_details table
ALTER TABLE production_standard_details
ADD COLUMN standard_fcr NUMERIC(15, 3);
+22 -10
View File
@@ -891,14 +891,14 @@ func seedProductWarehouse(tx *gorm.DB, createdBy uint) error {
WarehouseName string
Quantity float64
}{
{ProductName: "DOC Broiler", WarehouseName: "Gudang Priangan", Quantity: 100},
{ProductName: "281 SPECIAL STARTER", WarehouseName: "Gudang Singaparna", Quantity: 200},
{ProductName: "281 SPECIAL STARTER", WarehouseName: "Gudang Banten", Quantity: 300},
{ProductName: "DOC Broiler", WarehouseName: "Gudang Singaparna 1", Quantity: 5000},
{ProductName: "Telur Konsumsi Baik", WarehouseName: "Gudang Singaparna 1", Quantity: 600},
{ProductName: "Telur Pecah", WarehouseName: "Gudang Singaparna 1", Quantity: 80},
{ProductName: "Telur Konsumsi Baik", WarehouseName: "Gudang Cikaum 1", Quantity: 450},
{ProductName: "Telur Pecah", WarehouseName: "Gudang Cikaum 1", Quantity: 60},
{ProductName: "DOC Broiler", WarehouseName: "Gudang Priangan", Quantity: 0},
{ProductName: "281 SPECIAL STARTER", WarehouseName: "Gudang Singaparna", Quantity: 0},
{ProductName: "281 SPECIAL STARTER", WarehouseName: "Gudang Banten", Quantity: 0},
{ProductName: "DOC Broiler", WarehouseName: "Gudang Singaparna 1", Quantity: 0},
{ProductName: "Telur Konsumsi Baik", WarehouseName: "Gudang Singaparna 1", Quantity: 0},
{ProductName: "Telur Pecah", WarehouseName: "Gudang Singaparna 1", Quantity: 0},
{ProductName: "Telur Konsumsi Baik", WarehouseName: "Gudang Cikaum 1", Quantity: 0},
{ProductName: "Telur Pecah", WarehouseName: "Gudang Cikaum 1", Quantity: 0},
}
for _, seed := range seeds {
@@ -962,12 +962,24 @@ func seedTransferStock(tx *gorm.DB) error {
{
StockTransferId: transfer.Id,
ProductId: 1,
Quantity: 10,
SourceProductWarehouseID: func() *uint64 { id := uint64(1); return &id }(),
DestProductWarehouseID: func() *uint64 { id := uint64(2); return &id }(),
UsageQty: 10,
PendingQty: 0,
TotalQty: 10,
TotalUsed: 0,
},
{
StockTransferId: transfer.Id,
ProductId: 2,
Quantity: 5,
SourceProductWarehouseID: func() *uint64 { id := uint64(1); return &id }(),
DestProductWarehouseID: func() *uint64 { id := uint64(2); return &id }(),
UsageQty: 5,
PendingQty: 0,
TotalQty: 5,
TotalUsed: 0,
},
}
for i := range details {