Update Transaction
This commit is contained in:
parent
123ea5c8e8
commit
654ddc0b4a
@ -52,6 +52,8 @@ type TransactionList struct {
|
|||||||
SiteName string
|
SiteName string
|
||||||
PartnerName string
|
PartnerName string
|
||||||
Amount int64
|
Amount int64
|
||||||
|
Total int64
|
||||||
|
Fee int64
|
||||||
}
|
}
|
||||||
|
|
||||||
type TransactionApproval struct {
|
type TransactionApproval struct {
|
||||||
|
|||||||
@ -105,6 +105,8 @@ func (h *TransactionHandler) ToTransactionListResponse(transactions []*entity.Tr
|
|||||||
SiteName: transaction.SiteName,
|
SiteName: transaction.SiteName,
|
||||||
Amount: transaction.Amount,
|
Amount: transaction.Amount,
|
||||||
PartnerName: transaction.PartnerName,
|
PartnerName: transaction.PartnerName,
|
||||||
|
Total: transaction.Total,
|
||||||
|
Fee: transaction.Fee,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,8 @@ type TransactionListItem struct {
|
|||||||
SiteName string `json:"site_name"`
|
SiteName string `json:"site_name"`
|
||||||
Amount int64 `json:"amount"`
|
Amount int64 `json:"amount"`
|
||||||
PartnerName string `json:"partner_name"`
|
PartnerName string `json:"partner_name"`
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
Fee int64 `json:"fee"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TransactionListResponse struct {
|
type TransactionListResponse struct {
|
||||||
|
|||||||
@ -135,7 +135,7 @@ func (r *TransactionRepository) GetTransactionList(ctx mycontext.Context, req en
|
|||||||
var total int64
|
var total int64
|
||||||
|
|
||||||
query := r.db.Table("transactions t").
|
query := r.db.Table("transactions t").
|
||||||
Select("t.id, t.transaction_type, t.status, t.created_at, s.name as site_name, p.name as partner_name, t.amount").
|
Select("t.id, t.transaction_type, t.status, t.created_at, s.name as site_name, p.name as partner_name, t.amount, t.fee, t.total").
|
||||||
Joins("left join sites s on t.site_id = s.id").
|
Joins("left join sites s on t.site_id = s.id").
|
||||||
Joins("left join partners p on t.partner_id = p.id")
|
Joins("left join partners p on t.partner_id = p.id")
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ func NewServiceManagerImpl(cfg *config.Config, repo *repository.RepoManagerImpl)
|
|||||||
BranchSvc: branch.NewBranchService(repo.Branch),
|
BranchSvc: branch.NewBranchService(repo.Branch),
|
||||||
StudioSvc: studio.NewStudioService(repo.Studio),
|
StudioSvc: studio.NewStudioService(repo.Studio),
|
||||||
ProductSvc: product.NewProductService(repo.Product),
|
ProductSvc: product.NewProductService(repo.Product),
|
||||||
OrderSvc: order.NewOrderService(repo.Order, repo.Product, repo.Crypto, repo.Midtrans, repo.Payment, repo.Trx, repo.Wallet, &cfg.Order, repo.Transactiont add),
|
OrderSvc: order.NewOrderService(repo.Order, repo.Product, repo.Crypto, repo.Midtrans, repo.Payment, repo.Trx, repo.Wallet, &cfg.Order, repo.Transaction),
|
||||||
OSSSvc: oss.NewOSSService(repo.OSS),
|
OSSSvc: oss.NewOSSService(repo.OSS),
|
||||||
PartnerSvc: partner.NewPartnerService(
|
PartnerSvc: partner.NewPartnerService(
|
||||||
repo.Partner, users.NewUserService(repo.User, repo.Branch), repo.Trx, repo.Wallet, repo.User),
|
repo.Partner, users.NewUserService(repo.User, repo.Branch), repo.Trx, repo.Wallet, repo.User),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user