mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat: reimplement with plan hppv2 flow and logics
This commit is contained in:
@@ -498,6 +498,29 @@ func (c *RepportController) GetProductionResult(ctx *fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
|
||||
func (c *RepportController) GetHppV2Breakdown(ctx *fiber.Ctx) error {
|
||||
query := &validation.HppV2BreakdownQuery{
|
||||
ProjectFlockKandangID: uint(ctx.QueryInt("project_flock_kandang_id", 0)),
|
||||
Period: ctx.Query("period", ""),
|
||||
}
|
||||
|
||||
if err := m.EnsureProjectFlockKandangAccess(ctx, c.RepportService.DB(), 0, query.ProjectFlockKandangID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
data, err := c.RepportService.GetHppV2Breakdown(ctx, query)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return ctx.Status(fiber.StatusOK).JSON(response.Success{
|
||||
Code: fiber.StatusOK,
|
||||
Status: "success",
|
||||
Message: "Get HPP v2 breakdown successfully",
|
||||
Data: data,
|
||||
})
|
||||
}
|
||||
|
||||
func parseCommaSeparatedInt64s(raw string) ([]int64, error) {
|
||||
return parseCommaSeparatedInt64sWithField(raw, "supplier_ids")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user