From c5470fa0b94a93e47d548fd54c5e0b220e3a19d9 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:35:25 +0100 Subject: [PATCH] feat: clearing issuers instead of exception PAGOPA-2388 --- .../pagopa/afm/calculator/service/CalculatorService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java b/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java index 74cd36e6..611eca41 100644 --- a/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java +++ b/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java @@ -100,7 +100,9 @@ private List calculateTaxPayerFee( // is raised // - the limit(2) operation is used to terminate as soon as two distinct ABI objects are found if (isUniqueAbi(issuers)) { - throw new AppException(AppError.ISSUERS_BIN_WITH_DIFFERENT_ABI_ERROR, paymentOption.getBin()); + // fix to solve the problem with overlapping ranges of some psps + issuers.clear(); + //throw new AppException(AppError.ISSUERS_BIN_WITH_DIFFERENT_ABI_ERROR, paymentOption.getBin()); } for (ValidBundle bundle : bundles) { @@ -157,7 +159,9 @@ private List calcul // is raised // - the limit(2) operation is used to terminate as soon as two distinct ABI objects are found if (isUniqueAbi(issuers)) { - throw new AppException(AppError.ISSUERS_BIN_WITH_DIFFERENT_ABI_ERROR, paymentOption.getBin()); + // fix to solve the problem with overlapping ranges of some psps + issuers.clear(); + //throw new AppException(AppError.ISSUERS_BIN_WITH_DIFFERENT_ABI_ERROR, paymentOption.getBin()); } for (ValidBundle bundle : bundles) {