diff --git a/src/modules/provider-svc/provider-svc.service.test.ts b/src/modules/provider-svc/provider-svc.service.test.ts index 4bf26fa..8abda66 100644 --- a/src/modules/provider-svc/provider-svc.service.test.ts +++ b/src/modules/provider-svc/provider-svc.service.test.ts @@ -491,7 +491,9 @@ describe('ProviderService', () => { ); }); - it('should throw an error if the voucher currency is not XOF', async () => { + + it('should throw an error if the voucher currency is not CDF', async () => { + transactionRepository.findOne = jest.fn().mockResolvedValue({ ...mockTransaction, currency: 'USD' }); await expect( diff --git a/src/modules/provider-svc/provider-svc.service.ts b/src/modules/provider-svc/provider-svc.service.ts index f83591b..792ce21 100644 --- a/src/modules/provider-svc/provider-svc.service.ts +++ b/src/modules/provider-svc/provider-svc.service.ts @@ -319,14 +319,14 @@ export class ProviderService { const firstVoucher = { amount: Math.round(serviceTotal), ownerId: transaction.senderId, - currency: 'XOF', + currency: 'CDF', patientId: transaction.ownerId } const secondVoucher = { amount: (voucherValueInCDF - Math.round(serviceTotal)), ownerId: transaction.senderId, - currency: 'XOF', + currency: 'CDF', patientId: transaction.ownerId } @@ -438,9 +438,9 @@ export class ProviderService { //save first transaction split const transactionToSave1 = this.transactionRepository.create({ senderAmount: firstVoucher.amount, - senderCurrency: 'XOF', + senderCurrency: 'CDF', amount: firstVoucher.amount, - currency: 'XOF', + currency: 'CDF', conversionRate: 0, senderId: transaction.senderId, ownerId: transaction.ownerId, @@ -473,9 +473,9 @@ export class ProviderService { //save second transaction split const transactionToSave2 = this.transactionRepository.create({ senderAmount: secondVoucher.amount, - senderCurrency: 'XOF', + senderCurrency: 'CDF', amount: secondVoucher.amount, - currency: 'XOF', + currency: 'CDF', conversionRate: 0, senderId: transaction.senderId, ownerId: transaction.ownerId,