FEAT[BE] ;: inisiate customer payment report route and related DTOs

This commit is contained in:
aguhh18
2026-01-12 20:00:49 +07:00
parent 80b2cafd2f
commit f0b4fe916c
5 changed files with 95 additions and 4 deletions
@@ -282,6 +282,33 @@ func (c *RepportController) GetProductionResult(ctx *fiber.Ctx) error {
})
}
func (c *RepportController) GetCustomerPayment(ctx *fiber.Ctx) error {
page := ctx.QueryInt("page", 1)
limit := ctx.QueryInt("limit", 10)
if page < 1 || limit < 1 {
return fiber.NewError(fiber.StatusBadRequest, "page and limit must be greater than 0")
}
// TODO: Implement service call
data := []dto.CustomerPaymentReportItem{}
totalResults := int64(0)
return ctx.Status(fiber.StatusOK).
JSON(response.SuccessWithPaginate[dto.CustomerPaymentReportItem]{
Code: fiber.StatusOK,
Status: "success",
Message: "Get customer payment report successfully",
Meta: response.Meta{
Page: page,
Limit: limit,
TotalPages: int64(math.Ceil(float64(totalResults) / float64(limit))),
TotalResults: totalResults,
},
Data: data,
})
}
func parseCommaSeparatedInt64s(raw string) ([]int64, error) {
raw = strings.TrimSpace(raw)
if raw == "" {