From 6a3c5ee2d7f3a4cfb1b634d7485628b94e180088 Mon Sep 17 00:00:00 2001 From: Alessio Cialini Date: Thu, 11 Jan 2024 10:16:53 +0100 Subject: [PATCH 1/5] [PRDP-324] feat: updated BizEventToReceiptServiceImpl and BizEventToReceiptUtils to manage authenticated origin filter when setting payer fiscal code on receipt creation/recover --- .../impl/BizEventToReceiptServiceImpl.java | 21 +++++++++++------- .../utils/BizEventToReceiptUtils.java | 22 +++++++++++++++---- .../helpdesk/RecoverFailedReceiptTest.java | 13 ++--------- .../utils/BizEventToReceiptUtilsTest.java | 6 ----- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/service/impl/BizEventToReceiptServiceImpl.java b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/service/impl/BizEventToReceiptServiceImpl.java index a2b3cdf5..11b2e964 100644 --- a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/service/impl/BizEventToReceiptServiceImpl.java +++ b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/service/impl/BizEventToReceiptServiceImpl.java @@ -20,6 +20,7 @@ import it.gov.pagopa.receipt.pdf.helpdesk.entity.receipt.enumeration.ReasonErrorCode; import it.gov.pagopa.receipt.pdf.helpdesk.entity.receipt.enumeration.ReceiptStatusType; import it.gov.pagopa.receipt.pdf.helpdesk.exception.PDVTokenizerException; +import it.gov.pagopa.receipt.pdf.helpdesk.exception.PdfJsonMappingException; import it.gov.pagopa.receipt.pdf.helpdesk.service.BizEventToReceiptService; import it.gov.pagopa.receipt.pdf.helpdesk.service.PDVTokenizerServiceRetryWrapper; import it.gov.pagopa.receipt.pdf.helpdesk.utils.ObjectMapperUtils; @@ -31,8 +32,7 @@ import java.util.*; import java.util.concurrent.atomic.AtomicReference; -import static it.gov.pagopa.receipt.pdf.helpdesk.utils.BizEventToReceiptUtils.getAmount; -import static it.gov.pagopa.receipt.pdf.helpdesk.utils.BizEventToReceiptUtils.getItemSubject; +import static it.gov.pagopa.receipt.pdf.helpdesk.utils.BizEventToReceiptUtils.*; public class BizEventToReceiptServiceImpl implements BizEventToReceiptService { @@ -130,17 +130,22 @@ public void tokenizeFiscalCodes(BizEvent bizEvent, Receipt receipt, EventData ev if (bizEvent.getDebtor() != null && bizEvent.getDebtor().getEntityUniqueIdentifierValue() != null) { eventData.setDebtorFiscalCode("ANONIMO".equals(bizEvent.getDebtor().getEntityUniqueIdentifierValue()) ? bizEvent.getDebtor().getEntityUniqueIdentifierValue() : - pdvTokenizerService.generateTokenForFiscalCodeWithRetry(bizEvent.getDebtor().getEntityUniqueIdentifierValue()) + pdvTokenizerService.generateTokenForFiscalCodeWithRetry( + bizEvent.getDebtor().getEntityUniqueIdentifierValue()) ); } - if (bizEvent.getPayer() != null && bizEvent.getPayer().getEntityUniqueIdentifierValue() != null) { + if (bizEvent.getPayer() != null && bizEvent.getPayer().getEntityUniqueIdentifierValue() != null + && isFromAuthenticatedOrigin(bizEvent)) { eventData.setPayerFiscalCode( - pdvTokenizerService.generateTokenForFiscalCodeWithRetry(bizEvent.getPayer().getEntityUniqueIdentifierValue()) + pdvTokenizerService.generateTokenForFiscalCodeWithRetry( + bizEvent.getPayer().getEntityUniqueIdentifierValue()) ); - } else if (bizEvent.getTransactionDetails() != null && bizEvent.getTransactionDetails().getUser() != null && - bizEvent.getTransactionDetails().getUser().getFiscalCode() != null) { + } else if (bizEvent.getTransactionDetails() != null && bizEvent.getTransactionDetails().getUser() != null + && bizEvent.getTransactionDetails().getUser().getFiscalCode() != null + && isFromAuthenticatedOrigin(bizEvent)) { eventData.setPayerFiscalCode( - pdvTokenizerService.generateTokenForFiscalCodeWithRetry(bizEvent.getTransactionDetails().getUser().getFiscalCode()) + pdvTokenizerService.generateTokenForFiscalCodeWithRetry( + bizEvent.getTransactionDetails().getUser().getFiscalCode()) ); } } catch (PDVTokenizerException e) { diff --git a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/utils/BizEventToReceiptUtils.java b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/utils/BizEventToReceiptUtils.java index 91568753..4fa21f72 100644 --- a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/utils/BizEventToReceiptUtils.java +++ b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/utils/BizEventToReceiptUtils.java @@ -25,10 +25,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.UUID; +import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -37,6 +34,12 @@ public class BizEventToReceiptUtils { private static final String REMITTANCE_INFORMATION_REGEX = "/TXT/(.*)"; + private static final List listOrigin; + + static { + listOrigin = Arrays.asList(System.getenv().getOrDefault("LIST_VALID_ORIGINS", "IO").split(",")); + } + public static Receipt getEvent( String eventId, ExecutionContext context, @@ -420,5 +423,16 @@ public static BigDecimal formatAmount(long grandTotal) { return amount.divide(divider, 2, RoundingMode.UNNECESSARY); } + public static boolean isFromAuthenticatedOrigin(BizEvent bizEvent) { + return bizEvent.getTransactionDetails() != null && + ((bizEvent.getTransactionDetails().getTransaction() != null && + bizEvent.getTransactionDetails().getTransaction().getOrigin() != null && + listOrigin.contains(bizEvent.getTransactionDetails().getTransaction().getOrigin())) || + (bizEvent.getTransactionDetails().getInfo() != null && + bizEvent.getTransactionDetails().getInfo().getClientId() != null && + listOrigin.contains(bizEvent.getTransactionDetails().getInfo().getClientId()) + )); + } + private BizEventToReceiptUtils() {} } diff --git a/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedReceiptTest.java b/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedReceiptTest.java index 98c5d0a1..8df78604 100644 --- a/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedReceiptTest.java +++ b/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedReceiptTest.java @@ -101,8 +101,6 @@ public void releaseMocks() throws Exception { void requestOnValidBizEventShouldCreateRequest() { when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(DEBTOR_FISCAL_CODE)) .thenReturn(TOKENIZED_DEBTOR_FISCAL_CODE); - when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(PAYER_FISCAL_CODE)) - .thenReturn(TOKENIZED_PAYER_FISCAL_CODE); Response queueResponse = mock(Response.class); when(queueResponse.getStatusCode()).thenReturn(HttpStatus.CREATED.value()); @@ -130,7 +128,6 @@ void requestOnValidBizEventShouldCreateRequest() { Receipt captured = receiptCaptor.getValue(); assertEquals(ReceiptStatusType.INSERTED, captured.getStatus()); assertEquals(EVENT_ID, captured.getEventId()); - assertEquals(TOKENIZED_PAYER_FISCAL_CODE, captured.getEventData().getPayerFiscalCode()); assertEquals(TOKENIZED_DEBTOR_FISCAL_CODE, captured.getEventData().getDebtorFiscalCode()); assertNotNull(captured.getEventData().getCart()); assertEquals(1, captured.getEventData().getCart().size()); @@ -141,8 +138,6 @@ void requestOnValidBizEventShouldCreateRequest() { void requestOnValidCartShouldCreateRequest() { when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(DEBTOR_FISCAL_CODE)) .thenReturn(TOKENIZED_DEBTOR_FISCAL_CODE); - when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(PAYER_FISCAL_CODE)) - .thenReturn(TOKENIZED_PAYER_FISCAL_CODE); Response queueResponse = mock(Response.class); when(queueResponse.getStatusCode()).thenReturn(HttpStatus.CREATED.value()); @@ -175,7 +170,6 @@ void requestOnValidCartShouldCreateRequest() { Receipt captured = receiptCaptor.getValue(); assertEquals(ReceiptStatusType.INSERTED, captured.getStatus()); assertEquals(EVENT_ID, captured.getEventId()); - assertEquals(TOKENIZED_PAYER_FISCAL_CODE, captured.getEventData().getPayerFiscalCode()); assertEquals(TOKENIZED_DEBTOR_FISCAL_CODE, captured.getEventData().getDebtorFiscalCode()); assertNotNull(captured.getEventData().getCart()); assertEquals(1, captured.getEventData().getCart().size()); @@ -300,8 +294,6 @@ void requestOnValidCartAndFailedReceiptShouldResend() throws BizEventNotFoundExc void requestOnValidBizEventAndFailedReceiptWithoutEventDataShouldUpdateWithToken() { when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(DEBTOR_FISCAL_CODE)) .thenReturn(TOKENIZED_DEBTOR_FISCAL_CODE); - when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(PAYER_FISCAL_CODE)) - .thenReturn(TOKENIZED_PAYER_FISCAL_CODE); Response queueResponse = mock(Response.class); when(queueResponse.getStatusCode()).thenReturn(HttpStatus.CREATED.value()); @@ -331,7 +323,6 @@ void requestOnValidBizEventAndFailedReceiptWithoutEventDataShouldUpdateWithToken Receipt captured = receiptCaptor.getValue(); assertEquals(ReceiptStatusType.INSERTED, captured.getStatus()); assertEquals(EVENT_ID, captured.getEventId()); - assertEquals(TOKENIZED_PAYER_FISCAL_CODE, captured.getEventData().getPayerFiscalCode()); assertEquals(TOKENIZED_DEBTOR_FISCAL_CODE, captured.getEventData().getDebtorFiscalCode()); assertNotNull(captured.getEventData().getCart()); assertEquals(1, captured.getEventData().getCart().size()); @@ -517,8 +508,6 @@ void errorTokenizingFiscalCodes() { void errorAddingMessageToQueue() { when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(DEBTOR_FISCAL_CODE)) .thenReturn(TOKENIZED_DEBTOR_FISCAL_CODE); - when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(PAYER_FISCAL_CODE)) - .thenReturn(TOKENIZED_PAYER_FISCAL_CODE); Response queueResponse = mock(Response.class); when(queueResponse.getStatusCode()).thenReturn(HttpStatus.FORBIDDEN.value()); @@ -551,6 +540,7 @@ private BizEvent generateValidBizEvent(String totalNotice){ Transaction transaction = new Transaction(); transaction.setCreationDate(String.valueOf(LocalDateTime.now())); transactionDetails.setTransaction(transaction); + transactionDetails.setOrigin("INFO"); PaymentInfo paymentInfo = new PaymentInfo(); paymentInfo.setTotalNotice(totalNotice); @@ -572,6 +562,7 @@ private BizEvent generateValidBizEventWithTDetails(String totalNotice){ debtor.setEntityUniqueIdentifierValue(DEBTOR_FISCAL_CODE); TransactionDetails transactionDetails = new TransactionDetails(); + transactionDetails.setInfo(InfoTransaction.builder().clientId("IO").build()); Transaction transaction = new Transaction(); transaction.setCreationDate(String.valueOf(LocalDateTime.now())); transactionDetails.setTransaction(transaction); diff --git a/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/utils/BizEventToReceiptUtilsTest.java b/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/utils/BizEventToReceiptUtilsTest.java index 51442181..b2ed05c1 100644 --- a/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/utils/BizEventToReceiptUtilsTest.java +++ b/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/utils/BizEventToReceiptUtilsTest.java @@ -47,7 +47,6 @@ class BizEventToReceiptUtilsTest { @Test void createReceiptSuccessWithPaymentInfo() throws PDVTokenizerException, JsonProcessingException { when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(DEBTOR_FISCAL_CODE)).thenReturn(TOKENIZED_DEBTOR_FISCAL_CODE); - when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(PAYER_FISCAL_CODE)).thenReturn(TOKENIZED_PAYER_FISCAL_CODE); BizEventToReceiptServiceImpl receiptService = new BizEventToReceiptServiceImpl( pdvTokenizerServiceMock, mock(ReceiptQueueClientImpl.class), mock(BizEventCosmosClientImpl.class), mock(ReceiptCosmosClientImpl.class)); @@ -57,14 +56,12 @@ void createReceiptSuccessWithPaymentInfo() throws PDVTokenizerException, JsonPro assertEquals(EVENT_ID, receipt.getEventId()); assertNotNull(receipt.getId()); assertEquals(TOKENIZED_DEBTOR_FISCAL_CODE, receipt.getEventData().getDebtorFiscalCode()); - assertEquals(TOKENIZED_PAYER_FISCAL_CODE, receipt.getEventData().getPayerFiscalCode()); assertEquals(REMITTANCE_INFORMATION_PAYMENT_INFO, receipt.getEventData().getCart().get(0).getSubject()); } @Test void createReceiptSuccessWithoutPaymentInfoButWithTransferList() throws PDVTokenizerException, JsonProcessingException { when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(DEBTOR_FISCAL_CODE)).thenReturn(TOKENIZED_DEBTOR_FISCAL_CODE); - when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(PAYER_FISCAL_CODE)).thenReturn(TOKENIZED_PAYER_FISCAL_CODE); BizEventToReceiptServiceImpl receiptService = new BizEventToReceiptServiceImpl( pdvTokenizerServiceMock, mock(ReceiptQueueClientImpl.class), mock(BizEventCosmosClientImpl.class), mock(ReceiptCosmosClientImpl.class)); @@ -74,14 +71,12 @@ void createReceiptSuccessWithoutPaymentInfoButWithTransferList() throws PDVToken assertEquals(EVENT_ID, receipt.getEventId()); assertNotNull(receipt.getId()); assertEquals(TOKENIZED_DEBTOR_FISCAL_CODE, receipt.getEventData().getDebtorFiscalCode()); - assertEquals(TOKENIZED_PAYER_FISCAL_CODE, receipt.getEventData().getPayerFiscalCode()); assertEquals(REMITTANCE_INFORMATION_TRANSFER_LIST_FORMATTED, receipt.getEventData().getCart().get(0).getSubject()); } @Test void createReceiptSuccessWithoutRemittanceInformation() throws PDVTokenizerException, JsonProcessingException { when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(DEBTOR_FISCAL_CODE)).thenReturn(TOKENIZED_DEBTOR_FISCAL_CODE); - when(pdvTokenizerServiceMock.generateTokenForFiscalCodeWithRetry(PAYER_FISCAL_CODE)).thenReturn(TOKENIZED_PAYER_FISCAL_CODE); BizEventToReceiptServiceImpl receiptService = new BizEventToReceiptServiceImpl( pdvTokenizerServiceMock, mock(ReceiptQueueClientImpl.class), mock(BizEventCosmosClientImpl.class), mock(ReceiptCosmosClientImpl.class)); @@ -91,7 +86,6 @@ void createReceiptSuccessWithoutRemittanceInformation() throws PDVTokenizerExcep assertEquals(EVENT_ID, receipt.getEventId()); assertNotNull(receipt.getId()); assertEquals(TOKENIZED_DEBTOR_FISCAL_CODE, receipt.getEventData().getDebtorFiscalCode()); - assertEquals(TOKENIZED_PAYER_FISCAL_CODE, receipt.getEventData().getPayerFiscalCode()); assertNull(receipt.getEventData().getCart().get(0).getSubject()); } From a6aa19358ff88b2fb78cf75a2fc90f3241c21c22 Mon Sep 17 00:00:00 2001 From: Alessio Cialini Date: Thu, 11 Jan 2024 10:19:38 +0100 Subject: [PATCH 2/5] [PRDP-324] feat: updated RecoverFailedCart --- .../pagopa/receipt/pdf/helpdesk/RecoverFailedCart.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedCart.java b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedCart.java index 0be69afc..d4c786ba 100644 --- a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedCart.java +++ b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedCart.java @@ -55,12 +55,11 @@ public RecoverFailedCart(){ /** * This function will be invoked when a Http Trigger occurs. *

- * It recovers the receipt with the specified biz event id that has the following status: - * - ({@link ReceiptStatusType#INSERTED}) - * - ({@link ReceiptStatusType#FAILED}) - * - ({@link ReceiptStatusType#NOT_QUEUE_SENT}) + * It recovers the cart receipt with the specified cart id that has the following status: + * - ({@link CartStatusType#INSERTED}) + * - ({@link CartStatusType#FAILED}) *

- * It creates the receipts if not exist and send on queue the event in order to proceed with the receipt generation. + * It creates the cart rekated receipt if not exist and send on queue the event in order to proceed with the receipt generation. * * @return response with {@link HttpStatus#OK} if the operation succeeded */ From e3faeb69b8187eaeb3a41bead69943e9d32a8b5f Mon Sep 17 00:00:00 2001 From: Alessio Cialini Date: Thu, 11 Jan 2024 10:28:13 +0100 Subject: [PATCH 3/5] [PRDP-324] feat: updated RegenerateReceiptPdf to avoid setting tokenized payer fiscal code if not fromn an unauthenticated origin --- .../gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdf.java | 4 +++- .../pagopa/receipt/pdf/helpdesk/RecoverFailedCartTest.java | 1 + .../pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdfTest.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdf.java b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdf.java index a5be8265..2d8769f9 100644 --- a/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdf.java +++ b/src/main/java/it/gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdf.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.Optional; +import static it.gov.pagopa.receipt.pdf.helpdesk.utils.BizEventToReceiptUtils.isFromAuthenticatedOrigin; import static it.gov.pagopa.receipt.pdf.helpdesk.utils.GenerateReceiptUtils.*; @@ -119,7 +120,8 @@ && isHasAllAttachments(receipt) try { if (receipt.getEventData().getDebtorFiscalCode() == null || - receipt.getEventData().getPayerFiscalCode() == null) { + (receipt.getEventData().getPayerFiscalCode() == null + && isFromAuthenticatedOrigin(bizEvent))) { BizEventToReceiptUtils.tokenizeReceipt(bizEventToReceiptService, isCart ? listBizEvent : Collections.singletonList(bizEvent), receipt); documentdb.setValue(receipt); diff --git a/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedCartTest.java b/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedCartTest.java index 6d8c63fe..e3aa8aa0 100644 --- a/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedCartTest.java +++ b/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RecoverFailedCartTest.java @@ -302,6 +302,7 @@ private BizEvent generateValidBizEvent(String totalNotice){ Transaction transaction = new Transaction(); transaction.setCreationDate(String.valueOf(LocalDateTime.now())); transactionDetails.setTransaction(transaction); + transaction.setOrigin("IO"); PaymentInfo paymentInfo = new PaymentInfo(); paymentInfo.setTotalNotice(totalNotice); diff --git a/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdfTest.java b/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdfTest.java index 014989d5..5c3dca8a 100644 --- a/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdfTest.java +++ b/src/test/java/it/gov/pagopa/receipt/pdf/helpdesk/RegenerateReceiptPdfTest.java @@ -42,7 +42,7 @@ class RegenerateReceiptPdfTest { static { try { - bizEvent = ObjectMapperUtils.mapString("{\"id\":\"variant062-a330-4210-9c67-465b7d641aVS\",\"version\":\"2\",\"idPaymentManager\":null,\"complete\":\"false\",\"receiptId\":\"9a9bad2caf604b86a339476373c659b0\",\"missingInfo\":[\"idPaymentManager\",\"psp.pspPartitaIVA\",\"paymentInfo.primaryCiIncurredFee\",\"paymentInfo.idBundle\",\"paymentInfo.idCiBundle\",\"paymentInfo.metadata\"],\"debtorPosition\":{\"modelType\":\"2\",\"noticeNumber\":\"302119891614290410\",\"iuv\":\"02119891614290410\"},\"creditor\":{\"idPA\":\"66666666666\",\"idBrokerPA\":\"66666666666\",\"idStation\":\"66666666666_01\",\"companyName\":\"PA paolo\",\"officeName\":\"office PA\"},\"psp\":{\"idPsp\":\"60000000001\",\"idBrokerPsp\":\"60000000001\",\"idChannel\":\"60000000001_01\",\"psp\":\"PSP Paolo\",\"pspPartitaIVA\":null,\"pspFiscalCode\":\"CF60000000006\",\"channelDescription\":\"app\"},\"debtor\":{\"fullName\":\"John Doe\",\"entityUniqueIdentifierType\":\"F\",\"entityUniqueIdentifierValue\":\"JHNDOE00A01F205N\",\"streetName\":\"street\",\"civicNumber\":\"12\",\"postalCode\":\"89020\",\"city\":\"city\",\"stateProvinceRegion\":\"MI\",\"country\":\"IT\",\"eMail\":\"john.doe@test.it\"},\"payer\":{\"fullName\":\"John Doe\",\"entityUniqueIdentifierType\":\"F\",\"entityUniqueIdentifierValue\":\"JHNDOE00A01F205N\",\"streetName\":\"street\",\"civicNumber\":\"12\",\"postalCode\":\"89020\",\"city\":\"city\",\"stateProvinceRegion\":\"MI\",\"country\":\"IT\",\"eMail\":\"john.doe@test.it\"},\"paymentInfo\":{\"paymentDateTime\":\"2023-04-12T16:21:39.022486\",\"applicationDate\":\"2021-10-01\",\"transferDate\":\"2021-10-02\",\"dueDate\":\"2021-07-31\",\"paymentToken\":\"9a9bad2caf604b86a339476373c659b0\",\"amount\":\"7000\",\"fee\":\"200\",\"primaryCiIncurredFee\":null,\"idBundle\":null,\"idCiBundle\":null,\"totalNotice\":\"1\",\"paymentMethod\":\"creditCard\",\"touchpoint\":\"app\",\"remittanceInformation\":\"TARI 2021\",\"description\":\"TARI 2021\",\"metadata\":null},\"transferList\":[{\"idTransfer\":\"1\",\"fiscalCodePA\":\"77777777777\",\"companyName\":\"Pa Salvo\",\"amount\":\"7000\",\"transferCategory\":\"0101101IM\",\"remittanceInformation\":\"TARI Comune EC_TE\",\"metadata\":null,\"mbdattachment\":null,\"iban\":\"IT96R0123454321000000012345\"}],\"transactionDetails\":{\"transaction\":{\"psp\":{\"businessName\":\"Nexi\"}},\"wallet\":{\"info\":{\"brand\":\"MASTER\"}}},\"timestamp\":1686919660002,\"properties\":{},\"eventStatus\":\"DONE\",\"eventRetryEnrichmentCount\":0,\"eventTriggeredBySchedule\":false,\"eventErrorMessage\":null}",BizEvent.class); + bizEvent = ObjectMapperUtils.mapString("{\"id\":\"variant062-a330-4210-9c67-465b7d641aVS\",\"version\":\"2\",\"idPaymentManager\":null,\"complete\":\"false\",\"receiptId\":\"9a9bad2caf604b86a339476373c659b0\",\"missingInfo\":[\"idPaymentManager\",\"psp.pspPartitaIVA\",\"paymentInfo.primaryCiIncurredFee\",\"paymentInfo.idBundle\",\"paymentInfo.idCiBundle\",\"paymentInfo.metadata\"],\"debtorPosition\":{\"modelType\":\"2\",\"noticeNumber\":\"302119891614290410\",\"iuv\":\"02119891614290410\"},\"creditor\":{\"idPA\":\"66666666666\",\"idBrokerPA\":\"66666666666\",\"idStation\":\"66666666666_01\",\"companyName\":\"PA paolo\",\"officeName\":\"office PA\"},\"psp\":{\"idPsp\":\"60000000001\",\"idBrokerPsp\":\"60000000001\",\"idChannel\":\"60000000001_01\",\"psp\":\"PSP Paolo\",\"pspPartitaIVA\":null,\"pspFiscalCode\":\"CF60000000006\",\"channelDescription\":\"app\"},\"debtor\":{\"fullName\":\"John Doe\",\"entityUniqueIdentifierType\":\"F\",\"entityUniqueIdentifierValue\":\"JHNDOE00A01F205N\",\"streetName\":\"street\",\"civicNumber\":\"12\",\"postalCode\":\"89020\",\"city\":\"city\",\"stateProvinceRegion\":\"MI\",\"country\":\"IT\",\"eMail\":\"john.doe@test.it\"},\"payer\":{\"fullName\":\"John Doe\",\"entityUniqueIdentifierType\":\"F\",\"entityUniqueIdentifierValue\":\"JHNDOE00A01F205N\",\"streetName\":\"street\",\"civicNumber\":\"12\",\"postalCode\":\"89020\",\"city\":\"city\",\"stateProvinceRegion\":\"MI\",\"country\":\"IT\",\"eMail\":\"john.doe@test.it\"},\"paymentInfo\":{\"paymentDateTime\":\"2023-04-12T16:21:39.022486\",\"applicationDate\":\"2021-10-01\",\"transferDate\":\"2021-10-02\",\"dueDate\":\"2021-07-31\",\"paymentToken\":\"9a9bad2caf604b86a339476373c659b0\",\"amount\":\"7000\",\"fee\":\"200\",\"primaryCiIncurredFee\":null,\"idBundle\":null,\"idCiBundle\":null,\"totalNotice\":\"1\",\"paymentMethod\":\"creditCard\",\"touchpoint\":\"app\",\"remittanceInformation\":\"TARI 2021\",\"description\":\"TARI 2021\",\"metadata\":null},\"transferList\":[{\"idTransfer\":\"1\",\"fiscalCodePA\":\"77777777777\",\"companyName\":\"Pa Salvo\",\"amount\":\"7000\",\"transferCategory\":\"0101101IM\",\"remittanceInformation\":\"TARI Comune EC_TE\",\"metadata\":null,\"mbdattachment\":null,\"iban\":\"IT96R0123454321000000012345\"}],\"transactionDetails\":{\"transaction\":{\"origin\":\"IO\",\"psp\":{\"businessName\":\"Nexi\"}},\"wallet\":{\"info\":{\"brand\":\"MASTER\"}}},\"timestamp\":1686919660002,\"properties\":{},\"eventStatus\":\"DONE\",\"eventRetryEnrichmentCount\":0,\"eventTriggeredBySchedule\":false,\"eventErrorMessage\":null}",BizEvent.class); } catch (JsonProcessingException e) { throw new RuntimeException(e); } From d3189d0fa88c1eefbbf9a1d518a88c9175f53b5a Mon Sep 17 00:00:00 2001 From: Alessio Cialini Date: Thu, 11 Jan 2024 10:29:41 +0100 Subject: [PATCH 4/5] [PRDP-324] feat: updated values-dev.yaml, values-prod.yaml, values-uat.yaml --- helm/values-dev.yaml | 1 + helm/values-prod.yaml | 1 + helm/values-uat.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index f6deb1f0..56f5c80d 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -101,6 +101,7 @@ microservice-chart: PDV_TOKENIZER_MULTIPLIER: "2.0" PDV_TOKENIZER_RANDOMIZATION_FACTOR: "0.6" PDV_TOKENIZER_MAX_RETRIES: "3" + LIST_VALID_ORIGINS: "IO" ENABLE_ECS_CONSOLE: "true" CONSOLE_LOG_THRESHOLD: "DEBUG" CONSOLE_LOG_PATTERN: "%d{HH:mm:ss.SSS}[%thread]%-5level%logger{36}-%msg%n" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 6816c695..461c7324 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -101,6 +101,7 @@ microservice-chart: PDV_TOKENIZER_MULTIPLIER: "2.0" PDV_TOKENIZER_RANDOMIZATION_FACTOR: "0.6" PDV_TOKENIZER_MAX_RETRIES: "3" + LIST_VALID_ORIGINS: "IO" ENABLE_ECS_CONSOLE: "true" CONSOLE_LOG_THRESHOLD: "DEBUG" CONSOLE_LOG_PATTERN: "%d{HH:mm:ss.SSS}[%thread]%-5level%logger{36}-%msg%n" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 6e2df3d9..01d4467e 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -102,6 +102,7 @@ microservice-chart: PDV_TOKENIZER_RANDOMIZATION_FACTOR: "0.6" PDV_TOKENIZER_MAX_RETRIES: "3" ENABLE_ECS_CONSOLE: "true" + LIST_VALID_ORIGINS;: "IO" CONSOLE_LOG_THRESHOLD: "DEBUG" CONSOLE_LOG_PATTERN: "%d{HH:mm:ss.SSS}[%thread]%-5level%logger{36}-%msg%n" CONSOLE_LOG_CHARSET: "UTF-8" From 1c48f4d330acb695f5cbfa8195d18fb7bc213aff Mon Sep 17 00:00:00 2001 From: pasqualespica <36746022+pasqualespica@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:57:16 +0100 Subject: [PATCH 5/5] upd cron time --- helm/values-prod.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 461c7324..bd4af91e 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -113,8 +113,8 @@ microservice-chart: MAX_DATE_DIFF_MILLIS: "1800000" # 30min MAX_DATE_DIFF_NOTIFY_MILLIS: "1800000" # 30nin MAX_DATE_DIFF_CART_MILLIS: "1800000" # 30nin - TRIGGER_NOTIFY_REC_SCHEDULE: "0 */15 * * * *" - RECOVER_FAILED_CRON: "0 */15 * * * *" + TRIGGER_NOTIFY_REC_SCHEDULE: "0 */25 * * * *" + RECOVER_FAILED_CRON: "0 */30 * * * *" RECOVER_FAILED_CART_CRON: "0 0 */1 * * *" AZURE_FUNCTIONS_MESH_JAVA_OPTS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar -Xmx768m -XX:+UseG1GC" FAILED_AUTORECOVER_ENABLED: "true"