Skip to content

Commit

Permalink
fix: Sabadell Bank regression, missing date field during normalization (
Browse files Browse the repository at this point in the history
#474)

* fix: Sabadell Bank regression, missing date field during normalization

* release notes
  • Loading branch information
davidmartos96 authored Oct 12, 2024
1 parent 290c6f6 commit a8c4c5f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app-gocardless/banks/bancsabadell-bsabesbbb.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default {
return {
...transaction,
payeeName: formatPayeeName(transaction),
date: transaction.bookingDate || transaction.valueDate,
};
},
};
18 changes: 18 additions & 0 deletions src/app-gocardless/banks/tests/bancsabadell-bsabesbbb.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe('BancSabadell', () => {
remittanceInformationUnstructuredArray: ['some-creditor-name'],
internalTransactionId: 'd7dca139cf31d9',
transactionId: '04704109322',
bookingDate: '2022-05-01',
};
const normalizedTransaction = Sabadell.normalizeTransaction(
transaction,
Expand All @@ -26,6 +27,7 @@ describe('BancSabadell', () => {
remittanceInformationUnstructuredArray: ['some-debtor-name'],
internalTransactionId: 'd7dca139cf31d9',
transactionId: '04704109322',
bookingDate: '2022-05-01',
};
const normalizedTransaction = Sabadell.normalizeTransaction(
transaction,
Expand All @@ -35,5 +37,21 @@ describe('BancSabadell', () => {
expect(normalizedTransaction.creditorName).toEqual(null);
});
});

it('extract date', () => {
const transaction = {
transactionAmount: { amount: '-100', currency: 'EUR' },
remittanceInformationUnstructuredArray: ['some-creditor-name'],
internalTransactionId: 'd7dca139cf31d9',
transactionId: '04704109322',
bookingDate: '2024-10-02',
valueDate: '2024-10-05',
};
const normalizedTransaction = Sabadell.normalizeTransaction(
transaction,
true,
);
expect(normalizedTransaction.date).toEqual('2024-10-02');
});
});
});
6 changes: 6 additions & 0 deletions upcoming-release-notes/474.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [davidmartos96]
---

Fixes Sabadell Bank regression, by including the date field during normalization

0 comments on commit a8c4c5f

Please sign in to comment.