feat[BE}: change get penjualan repport dto an add more params

This commit is contained in:
aguhh18
2025-12-16 21:10:48 +07:00
parent 062a7937e2
commit afe4b2ffe3
10 changed files with 741 additions and 247 deletions
@@ -62,16 +62,18 @@ func (c *RepportController) GetExpense(ctx *fiber.Ctx) error {
func (c *RepportController) GetMarketing(ctx *fiber.Ctx) error {
query := &validation.MarketingQuery{
Page: ctx.QueryInt("page", 1),
Limit: ctx.QueryInt("limit", 10),
Search: ctx.Query("search", ""),
CustomerId: int64(ctx.QueryInt("customer_id", 0)),
ProjectFlockKandangId: int64(ctx.QueryInt("project_flock_kandang_id", 0)),
DeliveryDate: ctx.Query("delivery_date", ""),
ProductId: int64(ctx.QueryInt("product_id", 0)),
WarehouseId: int64(ctx.QueryInt("warehouse_id", 0)),
SalesPersonId: int64(ctx.QueryInt("sales_person_id", 0)),
MarketingId: int64(ctx.QueryInt("marketing_id", 0)),
Page: ctx.QueryInt("page", 1),
Limit: ctx.QueryInt("limit", 10),
Search: ctx.Query("search", ""),
CustomerId: int64(ctx.QueryInt("customer_id", 0)),
ProductId: int64(ctx.QueryInt("product_id", 0)),
WarehouseId: int64(ctx.QueryInt("warehouse_id", 0)),
SalesPersonId: int64(ctx.QueryInt("sales_person_id", 0)),
FilterBy: ctx.Query("filter_by", ""),
StartDate: ctx.Query("start_date", ""),
EndDate: ctx.Query("end_date", ""),
SortBy: ctx.Query("sort_by", ""),
SortOrder: ctx.Query("sort_order", ""),
}
if query.Page < 1 || query.Limit < 1 {
@@ -84,7 +86,7 @@ func (c *RepportController) GetMarketing(ctx *fiber.Ctx) error {
}
return ctx.Status(fiber.StatusOK).
JSON(response.SuccessWithPaginate[dto.RepportMarketingListDTO]{
JSON(response.SuccessWithPaginate[dto.RepportMarketingItemDTO]{
Code: fiber.StatusOK,
Status: "success",
Message: "Get marketing report successfully",