feat[BE-117]: create lookup API in project flock to get projectFlocks kandang id

This commit is contained in:
aguhh18
2025-10-23 09:03:28 +07:00
parent 00837e0da2
commit f33eb7fcc7
7 changed files with 214 additions and 3 deletions
@@ -244,3 +244,19 @@ func (u *ProjectflockController) GetFlockPeriodSummary(c *fiber.Ctx) error {
Data: responseBody,
})
}
func (u *ProjectflockController) LookupProjectFlockKandang(c *fiber.Ctx) error {
projectFlockIdStr := c.Query("project_flock_id", "")
kandangIdStr := c.Query("kandang_id", "")
result, err := u.ProjectflockService.GetProjectFlockKandangByParams(c, "", projectFlockIdStr, kandangIdStr)
if err != nil {
return err
}
return c.Status(fiber.StatusOK).
JSON(response.Success{Code: fiber.StatusOK,
Status: "success",
Message: "Get projectflock kandang successfully",
Data: dto.ToProjectFlockKandangDTO(*result)})
}