mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
FIX[BE]: name duplicate flock,projectflock category change,menerapkan dto seperti warehouse di projectflock
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user