Merge pull request 'history-order-list' (#3) from history-order-list into main
Reviewed-on: https://git.altru.id/Furtuna/furtuna-backend/pulls/3
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"furtuna-be/internal/common/mycontext"
|
||||
"furtuna-be/internal/entity"
|
||||
)
|
||||
|
||||
@@ -65,8 +66,10 @@ type SiteParam struct {
|
||||
Offset int `form:"offset,default=0"`
|
||||
}
|
||||
|
||||
func (r *SiteParam) ToEntity() entity.SiteSearch {
|
||||
func (r *SiteParam) ToEntity(ctx mycontext.Context) entity.SiteSearch {
|
||||
return entity.SiteSearch{
|
||||
PartnerID: ctx.GetPartnerID(),
|
||||
IsAdmin: ctx.IsAdmin(),
|
||||
Search: r.Search,
|
||||
Name: r.Name,
|
||||
Limit: r.Limit,
|
||||
|
||||
Reference in New Issue
Block a user