mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
FIX[BE]: if project flocs deleted kandangs reset to non_active and add filter get all project_flock by area,kandangs,period and location
This commit is contained in:
@@ -42,6 +42,7 @@ func setupIntegrationApp(t *testing.T) (*fiber.App, *gorm.DB) {
|
||||
&entities.Location{},
|
||||
&entities.Flock{},
|
||||
&entities.ProjectFlock{},
|
||||
&entities.ProjectFlockKandang{},
|
||||
&entities.Kandang{},
|
||||
&entities.Warehouse{},
|
||||
&entities.Uom{},
|
||||
@@ -191,6 +192,15 @@ func fetchCustomer(t *testing.T, db *gorm.DB, id uint) entities.Customer {
|
||||
return customer
|
||||
}
|
||||
|
||||
func fetchKandang(t *testing.T, db *gorm.DB, id uint) entities.Kandang {
|
||||
t.Helper()
|
||||
var kandang entities.Kandang
|
||||
if err := db.Preload("ProjectFlock").First(&kandang, id).Error; err != nil {
|
||||
t.Fatalf("failed to fetch kandang: %v", err)
|
||||
}
|
||||
return kandang
|
||||
}
|
||||
|
||||
func createSupplier(t *testing.T, app *fiber.App, name, alias, category string) uint {
|
||||
t.Helper()
|
||||
identifier := strings.ToLower(strings.ReplaceAll(name, " ", "_"))
|
||||
|
||||
Reference in New Issue
Block a user