From d637a69ee4ac61b9a59395dac70d157891054607 Mon Sep 17 00:00:00 2001 From: Matt Fiddaman Date: Mon, 16 Dec 2024 20:05:09 +0000 Subject: [PATCH] `ISYBANK_ITBBITMM` should prefer valueDate over bookingDate (#510) * prefer valueDate for isybank-itbbitmm * note * fix --- src/app-gocardless/bank-factory.js | 2 ++ src/app-gocardless/banks/isybank-itbbitmm.js | 16 ++++++++++++++++ upcoming-release-notes/510.md | 6 ++++++ 3 files changed, 24 insertions(+) create mode 100644 src/app-gocardless/banks/isybank-itbbitmm.js create mode 100644 upcoming-release-notes/510.md diff --git a/src/app-gocardless/bank-factory.js b/src/app-gocardless/bank-factory.js index aaa4f9304..d45879a2d 100644 --- a/src/app-gocardless/bank-factory.js +++ b/src/app-gocardless/bank-factory.js @@ -14,6 +14,7 @@ import IngIngbrobu from './banks/ing-ingbrobu.js'; import IngIngddeff from './banks/ing-ingddeff.js'; import IngPlIngbplpw from './banks/ing-pl-ingbplpw.js'; import IntegrationBank from './banks/integration-bank.js'; +import IsyBankItbbitmm from './banks/isybank-itbbitmm.js'; import KBCkredbebb from './banks/kbc_kredbebb.js'; import MbankRetailBrexplpw from './banks/mbank-retail-brexplpw.js'; import NationwideNaiaGB21 from './banks/nationwide-naiagb21.js'; @@ -46,6 +47,7 @@ export const banks = [ IngIngbrobu, IngIngddeff, IngPlIngbplpw, + IsyBankItbbitmm, KBCkredbebb, MbankRetailBrexplpw, NationwideNaiaGB21, diff --git a/src/app-gocardless/banks/isybank-itbbitmm.js b/src/app-gocardless/banks/isybank-itbbitmm.js new file mode 100644 index 000000000..a6685ccae --- /dev/null +++ b/src/app-gocardless/banks/isybank-itbbitmm.js @@ -0,0 +1,16 @@ +import Fallback from './integration-bank.js'; + +/** @type {import('./bank.interface.js').IBank} */ +export default { + ...Fallback, + + institutionIds: ['ISYBANK_ITBBITMM'], + + // It has been reported that valueDate is more accurate than booking date + // when it is provided + normalizeTransaction(transaction, booked) { + transaction.bookingDate = transaction.valueDate ?? transaction.bookingDate; + + return Fallback.normalizeTransaction(transaction, booked); + }, +}; diff --git a/upcoming-release-notes/510.md b/upcoming-release-notes/510.md new file mode 100644 index 000000000..9f91704e4 --- /dev/null +++ b/upcoming-release-notes/510.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [matt-fidd] +--- + +GoCardless: `ISYBANK_ITBBITMM` should prefer valueDate over bookingDate