diff --git a/src/app-gocardless/banks/bancsabadell-bsabesbbb.js b/src/app-gocardless/banks/bancsabadell-bsabesbbb.js index 52802ebb4..832fb8953 100644 --- a/src/app-gocardless/banks/bancsabadell-bsabesbbb.js +++ b/src/app-gocardless/banks/bancsabadell-bsabesbbb.js @@ -31,6 +31,7 @@ export default { return { ...transaction, payeeName: formatPayeeName(transaction), + date: transaction.bookingDate || transaction.valueDate, }; }, }; diff --git a/src/app-gocardless/banks/tests/bancsabadell-bsabesbbb.spec.js b/src/app-gocardless/banks/tests/bancsabadell-bsabesbbb.spec.js index e33be8524..61071084e 100644 --- a/src/app-gocardless/banks/tests/bancsabadell-bsabesbbb.spec.js +++ b/src/app-gocardless/banks/tests/bancsabadell-bsabesbbb.spec.js @@ -9,6 +9,7 @@ describe('BancSabadell', () => { remittanceInformationUnstructuredArray: ['some-creditor-name'], internalTransactionId: 'd7dca139cf31d9', transactionId: '04704109322', + bookingDate: '2022-05-01', }; const normalizedTransaction = Sabadell.normalizeTransaction( transaction, @@ -26,6 +27,7 @@ describe('BancSabadell', () => { remittanceInformationUnstructuredArray: ['some-debtor-name'], internalTransactionId: 'd7dca139cf31d9', transactionId: '04704109322', + bookingDate: '2022-05-01', }; const normalizedTransaction = Sabadell.normalizeTransaction( transaction, @@ -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'); + }); }); }); diff --git a/upcoming-release-notes/474.md b/upcoming-release-notes/474.md new file mode 100644 index 000000000..2e2e3623f --- /dev/null +++ b/upcoming-release-notes/474.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [davidmartos96] +--- + +Fixes Sabadell Bank regression, by including the date field during normalization