Add Transaction
This commit is contained in:
@@ -1,9 +1,31 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"furtuna-be/internal/common/mycontext"
|
||||
"furtuna-be/internal/constants/transaction"
|
||||
"furtuna-be/internal/entity"
|
||||
)
|
||||
|
||||
type Transaction struct {
|
||||
PaymentMethod transaction.PaymentMethod
|
||||
}
|
||||
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user