FIX[BE]: name duplicate flock,projectflock category change,menerapkan dto seperti warehouse di projectflock

This commit is contained in:
ragilap
2025-10-20 16:39:16 +07:00
parent f15e0d62e3
commit ee033b8fe6
10 changed files with 290 additions and 285 deletions
+8 -8
View File
@@ -8,6 +8,7 @@ import (
"github.com/gofiber/fiber/v2"
"gitlab.com/mbugroup/lti-api.git/internal/entities"
"gitlab.com/mbugroup/lti-api.git/internal/utils"
)
func TestKandangIntegration(t *testing.T) {
@@ -51,20 +52,19 @@ func TestKandangIntegration(t *testing.T) {
})
t.Run("cannot assign project floc with existing active kandang", func(t *testing.T) {
categoryID := createProductCategory(t, app, "DOC Category", "DOC1")
fcrID := createFcr(t, app, "FCR For Floc", []map[string]any{
{"weight": 1.0, "fcr_number": 1.5, "mortality": 2.0},
})
flocID := createFlock(t, app, "Floc Test")
projectFloc := entities.ProjectFlock{
FlockId: flocID,
AreaId: areaID,
ProductCategoryId: categoryID,
FcrId: fcrID,
LocationId: locationID,
Period: 1,
CreatedBy: 1,
FlockId: flocID,
AreaId: areaID,
Category: string(utils.ProjectFlockCategoryGrowing),
FcrId: fcrID,
LocationId: locationID,
Period: 1,
CreatedBy: 1,
}
if err := db.Create(&projectFloc).Error; err != nil {
t.Fatalf("failed to seed project floc: %v", err)