mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat/BE/US-74/pengajuan-flock
This commit is contained in:
@@ -40,6 +40,8 @@ func setupIntegrationApp(t *testing.T) (*fiber.App, *gorm.DB) {
|
||||
&entities.User{},
|
||||
&entities.Area{},
|
||||
&entities.Location{},
|
||||
&entities.Flock{},
|
||||
&entities.ProjectFlock{},
|
||||
&entities.Kandang{},
|
||||
&entities.Warehouse{},
|
||||
&entities.Uom{},
|
||||
@@ -152,6 +154,7 @@ func createKandang(t *testing.T, app *fiber.App, name string, locationID, picID
|
||||
t.Helper()
|
||||
resp, body := doJSONRequest(t, app, http.MethodPost, "/api/master-data/kandangs", map[string]any{
|
||||
"name": name,
|
||||
"status": "ACTIVE",
|
||||
"location_id": locationID,
|
||||
"pic_id": picID,
|
||||
})
|
||||
@@ -291,6 +294,17 @@ func createFcr(t *testing.T, app *fiber.App, name string, standards []map[string
|
||||
return parseID(t, body)
|
||||
}
|
||||
|
||||
func createFlock(t *testing.T, app *fiber.App, name string) uint {
|
||||
t.Helper()
|
||||
resp, body := doJSONRequest(t, app, http.MethodPost, "/api/master-data/flocks", map[string]any{
|
||||
"name": name,
|
||||
})
|
||||
if resp.StatusCode != fiber.StatusCreated {
|
||||
t.Fatalf("expected 201 when creating flock, got %d: %s", resp.StatusCode, string(body))
|
||||
}
|
||||
return parseID(t, body)
|
||||
}
|
||||
|
||||
func fetchFcr(t *testing.T, db *gorm.DB, id uint) entities.Fcr {
|
||||
t.Helper()
|
||||
var fcr entities.Fcr
|
||||
|
||||
Reference in New Issue
Block a user