feat: amount transaction and count of item

This commit is contained in:
ferdiansyah783
2024-07-27 16:47:33 +07:00
parent 4013b12ac9
commit 30aa206d80
9 changed files with 192 additions and 19 deletions
+7 -5
View File
@@ -12,15 +12,17 @@ type Order struct {
OrderItems []OrderItem `json:"order_items" validate:"required"`
}
type HistoryOrderParam struct {
Limit int `form:"limit" json:"limit" example:"10"`
Offset int `form:"offset" json:"offset" example:"0"`
type OrderParam struct {
PaymentType string `form:"payment_type" json:"payment_type" example:"CASH"`
Limit int `form:"limit" json:"limit" example:"10"`
Offset int `form:"offset" json:"offset" example:"0"`
}
func (o *HistoryOrderParam) ToEntity(ctx mycontext.Context) entity.HistoryOrderSearch {
return entity.HistoryOrderSearch{
func (o *OrderParam) ToOrderEntity(ctx mycontext.Context) entity.OrderSearch {
return entity.OrderSearch{
PartnerID: ctx.GetPartnerID(),
IsAdmin: ctx.IsAdmin(),
PaymentType: o.PaymentType,
Limit: o.Limit,
Offset: o.Offset,
}