mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 14:55:42 +00:00
fix(BE): add party account number in payments
This commit is contained in:
@@ -101,20 +101,25 @@ func ToInitialDetailDTO(e entity.Payment) InitialDetailDTO {
|
||||
|
||||
func partyFromInitial(e entity.Payment) Party {
|
||||
party := Party{
|
||||
Id: e.PartyId,
|
||||
Type: e.PartyType,
|
||||
Id: e.PartyId,
|
||||
Type: e.PartyType,
|
||||
}
|
||||
if e.PartyAccountNumber != nil {
|
||||
party.AccountNumber = *e.PartyAccountNumber
|
||||
}
|
||||
|
||||
switch utils.PaymentParty(e.PartyType) {
|
||||
case utils.PaymentPartyCustomer:
|
||||
if e.Customer != nil && e.Customer.Id != 0 {
|
||||
party.Name = e.Customer.Name
|
||||
party.AccountNumber = e.Customer.AccountNumber
|
||||
if party.AccountNumber == "" {
|
||||
party.AccountNumber = e.Customer.AccountNumber
|
||||
}
|
||||
}
|
||||
case utils.PaymentPartySupplier:
|
||||
if e.Supplier != nil && e.Supplier.Id != 0 {
|
||||
party.Name = e.Supplier.Name
|
||||
if e.Supplier.AccountNumber != nil {
|
||||
if party.AccountNumber == "" && e.Supplier.AccountNumber != nil {
|
||||
party.AccountNumber = *e.Supplier.AccountNumber
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@ func (s *initialService) CreateOne(c *fiber.Ctx, req *validation.Create) (*entit
|
||||
TransactionType: string(utils.TransactionTypeSaldoAwal),
|
||||
PartyType: party,
|
||||
PartyId: req.PartyId,
|
||||
PartyAccountNumber: nil,
|
||||
PaymentDate: time.Now(),
|
||||
PaymentMethod: string(utils.PaymentMethodSaldo),
|
||||
BankId: req.BankId,
|
||||
|
||||
Reference in New Issue
Block a user