From 07530198fd0bbd25619694308df11b6cc6daf7d4 Mon Sep 17 00:00:00 2001 From: Jeremy Herman Date: Mon, 11 May 2026 11:57:03 -0400 Subject: [PATCH 1/2] fix(ca): fix pix qualifying mutations --- src/server/locale/CA/mutations/short_term_q.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/server/locale/CA/mutations/short_term_q.js b/src/server/locale/CA/mutations/short_term_q.js index bd10412b2a..90298255b2 100644 --- a/src/server/locale/CA/mutations/short_term_q.js +++ b/src/server/locale/CA/mutations/short_term_q.js @@ -141,11 +141,7 @@ export default { headline: [ { tag: 'medium', - br: ['payments', 'versements'], - replace: [ - ['00.', '00'], - ['00 $.', '00 $'] - ] + br: ['payments', 'versements'] }, { tag: 'xsmall.2', @@ -165,11 +161,7 @@ export default { headline: [ { tag: 'medium', - br: ['payments', 'versements'], - replace: [ - ['00.', '00'], - ['00 $.', '00 $'] - ] + br: ['payments', 'versements'] }, { tag: 'xsmall.2', From f2a1dd1ff60be437ddb1c9adce5ba119406d447b Mon Sep 17 00:00:00 2001 From: jeremy-herman Date: Mon, 11 May 2026 12:43:02 -0400 Subject: [PATCH 2/2] feat(devAccountDetails): update message selection --- utils/devServerProxy/lib/devAccountDetails.js | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/utils/devServerProxy/lib/devAccountDetails.js b/utils/devServerProxy/lib/devAccountDetails.js index 9a2c1580bc..1ee5b062d3 100644 --- a/utils/devServerProxy/lib/devAccountDetails.js +++ b/utils/devServerProxy/lib/devAccountDetails.js @@ -20,6 +20,24 @@ const selectBestOffer = (offers = [], amount) => undefined ); +const selectMessageThreshold = (messageThresholds, amount) => { + const numberAmount = Number(amount); + + if (amount === undefined || amount === '' || Number.isNaN(numberAmount)) { + return messageThresholds.find(({ amount: minAmount }) => minAmount === 0) ?? messageThresholds[0]; + } + + return ( + messageThresholds.reduce( + (selected, threshold) => + threshold.amount <= numberAmount && (!selected || threshold.amount > selected.amount) + ? threshold + : selected, + undefined + ) ?? messageThresholds[0] + ); +}; + /** * @description Get labels based on country * @param {string} country @@ -121,10 +139,7 @@ export default function getDevAccountDetails({ account, amount, buyerCountry }) if (devAccountMapV2[account]) { const { country, modalViews, messageThresholds, offers } = devAccountMapV2[account]; - const selectedMessage = - messageThresholds.findLast( - ({ amount: minAmount }) => (amount === undefined && amount === minAmount) || minAmount <= amount - ) ?? messageThresholds[0]; + const selectedMessage = selectMessageThreshold(messageThresholds, amount); const messageTemplate = buyerCountry && buyerCountry !== country && selectedMessage.templateXB