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
@@ -109,7 +109,7 @@ func (s *chickinService) CreateOne(c *fiber.Ctx, req *validation.Create) (*entit
return nil, err
}
projectflockkandang, err := s.ProjectflockKandangRepo.GetByID(c.Context(), 1)
projectflockkandang, err := s.ProjectflockKandangRepo.GetByID(c.Context(), req.ProjectFlockKandangId)
if err != nil {
s.Log.Errorf("Failed to get projectflock kandang: %+v", err)
return nil, err
@@ -154,7 +154,7 @@ func (s *chickinService) CreateOne(c *fiber.Ctx, req *validation.Create) (*entit
return nil, fiber.NewError(fiber.StatusBadRequest, "Invalid ChickInDate format")
}
newChickin := &entity.ProjectChickin{
ProjectFlockKandangId: projectflockkandang.ProjectFlockId,
ProjectFlockKandangId: projectflockkandang.Id,
ChickInDate: chickinDate,
Quantity: totalQuantity,
Note: "",