feat: filter order history

This commit is contained in:
fernanda-one
2024-08-10 23:21:01 +07:00
parent 2fd676ef3e
commit b1c1c0260b
14 changed files with 23 additions and 3 deletions
BIN
View File
Binary file not shown.
Binary file not shown.
+3
View File
@@ -173,6 +173,9 @@ func (h *Handler) toHistoryOrderResponse(resp *entity.HistoryOrder) response.His
PaymentType: resp.PaymentType,
Status: resp.Status,
Amount: resp.Amount,
VisitDate: resp.VisitDate.Format(time.RFC3339),
TicketStatus: resp.TicketStatus,
Source: resp.Source,
}
}
+2
View File
@@ -44,6 +44,7 @@ type OrderParam struct {
Limit int `form:"limit" json:"limit" example:"10"`
Offset int `form:"offset" json:"offset" example:"0"`
Period string `form:"period" json:"period" example:"1d,7d,1m"`
Source string `form:"source" json:"source" example:"tes"`
}
func (o *OrderParam) ToOrderEntity(ctx mycontext.Context) entity.OrderSearch {
@@ -58,6 +59,7 @@ func (o *OrderParam) ToOrderEntity(ctx mycontext.Context) entity.OrderSearch {
EndDate: o.EndDate,
Status: o.Status,
Period: o.Period,
Source: o.Source,
}
}
+3
View File
@@ -35,6 +35,9 @@ type HistoryOrder struct {
PaymentType string `json:"payment_type"`
Status string `json:"status"`
Amount float64 `json:"amount"`
VisitDate string `json:"visit_date"`
TicketStatus string `json:"ticket_status"`
Source string `json:"source"`
}
type OrderItem struct {