32 lines
780 B
Go
Raw Normal View History

2023-10-08 15:59:42 +07:00
package request
import (
2024-07-30 23:39:55 +07:00
"furtuna-be/internal/common/mycontext"
2023-10-08 15:59:42 +07:00
"furtuna-be/internal/constants/transaction"
2024-07-30 23:39:55 +07:00
"furtuna-be/internal/entity"
2023-10-08 15:59:42 +07:00
)
type Transaction struct {
PaymentMethod transaction.PaymentMethod
}
2024-07-30 23:39:55 +07:00
type TransactionSearch struct {
Id string `form:"id" json:"id" example:"1"`
Date string `form:"date" json:"date" example:"1"`
Limit int `form:"limit,default=10"`
Offset int `form:"offset,default=0"`
Status string `form:"status,default="`
Type string `form:"type,default="`
}
func (t *TransactionSearch) ToEntity(ctx mycontext.Context) entity.TransactionSearch {
return entity.TransactionSearch{
PartnerID: ctx.GetPartnerID(),
Type: t.Type,
Status: t.Status,
Limit: t.Limit,
Offset: t.Offset,
Date: t.Date,
}
}