Update Transaction

This commit is contained in:
aditya.siregar 2024-08-28 00:32:19 +07:00
parent 123ea5c8e8
commit 654ddc0b4a
5 changed files with 8 additions and 2 deletions

View File

@ -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 {

View File

@ -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,
} }
} }

View File

@ -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 {

View File

@ -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")

View File

@ -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),