Skip to content

Commit

Permalink
Merge branch 'main' into PAGOPA-2249
Browse files Browse the repository at this point in the history
  • Loading branch information
cap-ang authored Oct 14, 2024
2 parents a993080 + 2e661a3 commit 78e6723
Show file tree
Hide file tree
Showing 40 changed files with 763 additions and 216 deletions.
7 changes: 5 additions & 2 deletions helm/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ dependencies:
- name: microservice-chart
repository: https://pagopa.github.io/aks-microservice-chart-blueprint
version: 3.0.0
digest: sha256:47c6b74ce3ca60c2d4eee8e65c65597e5f62fb420653fcaec310eaa51b472413
generated: "2024-04-09T17:12:54.285532+02:00"
- name: microservice-chart
repository: https://pagopa.github.io/aks-microservice-chart-blueprint
version: 3.0.0
digest: sha256:054952d2271feb275decce7d04d04de803455f4eb23f7654d74225da68424db4
generated: "2024-10-03T10:05:37.640461+02:00"
8 changes: 6 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ apiVersion: v2
name: pagopa-wisp-converter
description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system
type: application
version: 0.225.0
appVersion: 0.4.4-3-release-v0.4.x
version: 0.232.0
appVersion: 0.4.6
dependencies:
- name: microservice-chart
version: 3.0.0
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint"
- name: microservice-chart
version: 3.0.0
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint"
alias: cron
51 changes: 43 additions & 8 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
microservice-chart:
microservice-chart: &microservice-chart
namespace: "nodo"
nameOverride: ""
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.4.4-3-release-v0.4.x"
tag: "0.4.6"
pullPolicy: Always
livenessProbe:
httpGet:
Expand All @@ -27,7 +27,7 @@ microservice-chart:
type: ClusterIP
ports:
- 8080
ingress:
ingress: &ingress
create: true
host: "weudev.nodo.internal.dev.platform.pagopa.it"
path: /pagopa-wisp-converter(/|$)(.*)
Expand All @@ -42,7 +42,7 @@ microservice-chart:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
resources:
resources: &resources
requests:
memory: "256Mi"
cpu: "0.15"
Expand All @@ -61,7 +61,7 @@ microservice-chart:
# Required
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "75"
envConfig:
envConfig: &envConfig
WEBSITE_SITE_NAME: 'pagopawispconverter' # required to show cloud role name in application insights
ENV: 'aks-dev'
APP_LOGGING_LEVEL: 'DEBUG'
Expand Down Expand Up @@ -98,9 +98,9 @@ microservice-chart:
STATION_IN_GPD_PARTIAL_PATH: 'gpd-payments/api/v1'
RT_SEND_MAX_RETRIES: '5'
RT_SEND_SCHEDULING_TIME_IN_MINUTES: '1'
RT_SEND_AVOID_SCHEDULING_ON_STATES: 'PAA_RT_DUPLICATA'
RT_SEND_NO_DEAD_LETTER_ON_STATES: 'PAA_ID_DOMINIO_ERRATO,PAA_ID_INTERMEDIARIO_ERRATO,PAA_STAZIONE_INT_ERRATA,PAA_PAGAMENTO_SCONOSCIUTO,PAA_PAGAMENTO_DUPLICATO,PAA_PAGAMENTO_IN_CORSO,PAA_PAGAMENTO_ANNULLATO,PAA_PAGAMENTO_SCADUTO,PAA_SYSTEM_ERROR'
RPT_TIMER_QUEUE_NAME: "nodo_wisp_rpt_timeout_queue"
CRON_JOB_SCHEDULE_RECOVERY_ENABLED: 'true'
CRON_JOB_SCHEDULE_RECOVERY_ENABLED: 'false'
CRON_JOB_SCHEDULE_RECOVERY_RECEIPT_KO_ENABLED: '0 0 * * * *' # top of every hour of every
CRON_JOB_SCHEDULE_RECOVERY_FROM_HOURS_AGO: '2' # from 2 hours ago
CRON_JOB_SCHEDULE_RECOVERY_UNTIL_HOURS_AGO: '1' # until 1 hours ago
Expand All @@ -118,7 +118,7 @@ microservice-chart:
SPRING_PROFILES_ACTIVE: "default,jsonLog"
secretProvider:
create: true
envSecrets:
envSecrets: &envSecret
# required
APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string'
SERVICE_BUS_PAYMENT_TIMEOUT_QUEUE_CONNECTION_STRING: 'wisp-payment-timeout-queue-connection-string'
Expand Down Expand Up @@ -170,3 +170,38 @@ microservice-chart:
pullPolicy: Always
envConfig: {}
envSecret: {}
# 1 - wisp converter service
app:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
resources:
!!merge <<: *resources
envConfig:
!!merge <<: *envConfig
envSecret:
!!merge <<: *envSecret
# 2 - wisp converter cron
cron:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
path: /pagopa-wisp-converter-notused/(.*)
resources:
!!merge <<: *resources
requests:
memory: "256Mi"
cpu: "0.15"
limits:
memory: "768Mi"
cpu: "0.25"
autoscaling:
enable: true
minReplica: 1
maxReplica: 1
envConfig:
!!merge <<: *envConfig
CRON_JOB_SCHEDULE_RECOVERY_ENABLED: 'true'
DISABLE_SERVICE_BUS_RECEIVER: 'true'
envSecret:
!!merge <<: *envSecret
49 changes: 42 additions & 7 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
microservice-chart:
microservice-chart: &microservice-chart
namespace: "nodo"
nameOverride: ""
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.4.4-3-release-v0.4.x"
tag: "0.4.6"
pullPolicy: Always
livenessProbe:
httpGet:
Expand All @@ -27,7 +27,7 @@ microservice-chart:
type: ClusterIP
ports:
- 8080
ingress:
ingress: &ingress
create: true
host: "weuprod.nodo.internal.platform.pagopa.it"
path: /pagopa-wisp-converter(/|$)(.*)
Expand All @@ -42,7 +42,7 @@ microservice-chart:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
resources:
resources: &resources
requests:
memory: "640Mi"
cpu: "200m"
Expand Down Expand Up @@ -79,7 +79,7 @@ microservice-chart:
- type: Percent
value: 100
periodSeconds: 20
envConfig:
envConfig: &envConfig
JAVA_OPTS: "-XX:MaxHeapSize=1780m -XX:MinHeapSize=64m"
WEBSITE_SITE_NAME: 'pagopawispconverter' # required to show cloud role name in application insights
ENV: 'aks-prod'
Expand Down Expand Up @@ -117,7 +117,7 @@ microservice-chart:
STATION_IN_GPD_PARTIAL_PATH: 'gpd-payments/api/v1'
RT_SEND_MAX_RETRIES: '5'
RT_SEND_SCHEDULING_TIME_IN_MINUTES: '60'
RT_SEND_AVOID_SCHEDULING_ON_STATES: 'PAA_RT_DUPLICATA'
RT_SEND_NO_DEAD_LETTER_ON_STATES: 'PAA_ID_DOMINIO_ERRATO,PAA_ID_INTERMEDIARIO_ERRATO,PAA_STAZIONE_INT_ERRATA,PAA_PAGAMENTO_SCONOSCIUTO,PAA_PAGAMENTO_DUPLICATO,PAA_PAGAMENTO_IN_CORSO,PAA_PAGAMENTO_ANNULLATO,PAA_PAGAMENTO_SCADUTO,PAA_SYSTEM_ERROR' # i.e. retry to send
RPT_TIMER_QUEUE_NAME: "nodo_wisp_rpt_timeout_queue"
CRON_JOB_SCHEDULE_RECOVERY_ENABLED: 'false'
CRON_JOB_SCHEDULE_RECOVERY_RECEIPT_KO_ENABLED: '0 0 * * * *' # top of every hour of every day
Expand All @@ -137,7 +137,7 @@ microservice-chart:
SPRING_PROFILES_ACTIVE: "default,jsonLog"
secretProvider:
create: true
envSecrets:
envSecrets: &envSecret
# required
APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string'
SERVICE_BUS_PAYMENT_TIMEOUT_QUEUE_CONNECTION_STRING: 'wisp-payment-timeout-queue-connection-string'
Expand Down Expand Up @@ -189,3 +189,38 @@ microservice-chart:
pullPolicy: Always
envConfig: {}
envSecret: {}
# 1 - wisp converter service
app:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
resources:
!!merge <<: *resources
envConfig:
!!merge <<: *envConfig
envSecret:
!!merge <<: *envSecret
# 2 - wisp converter cron
cron:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
path: /pagopa-wisp-converter-notused/(.*)
resources:
!!merge <<: *resources
requests:
memory: "640Mi"
cpu: "0.20"
limits:
memory: "2048Mi"
cpu: "0.50"
autoscaling:
enable: true
minReplica: 1
maxReplica: 1
envConfig:
!!merge <<: *envConfig
CRON_JOB_SCHEDULE_RECOVERY_ENABLED: 'false'
DISABLE_SERVICE_BUS_RECEIVER: 'true'
envSecret:
!!merge <<: *envSecret
51 changes: 43 additions & 8 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
microservice-chart:
microservice-chart: &microservice-chart
namespace: "nodo"
nameOverride: ""
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.4.4-3-release-v0.4.x"
tag: "0.4.6"
pullPolicy: Always
livenessProbe:
httpGet:
Expand All @@ -27,7 +27,7 @@ microservice-chart:
type: ClusterIP
ports:
- 8080
ingress:
ingress: &ingress
create: true
host: "weuuat.nodo.internal.uat.platform.pagopa.it"
path: /pagopa-wisp-converter(/|$)(.*)
Expand All @@ -42,7 +42,7 @@ microservice-chart:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
resources:
resources: &resources
requests:
memory: "512Mi"
cpu: "0.25"
Expand All @@ -61,7 +61,7 @@ microservice-chart:
# Required
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "75"
envConfig:
envConfig: &envConfig
WEBSITE_SITE_NAME: 'pagopawispconverter' # required to show cloud role name in application insights
ENV: 'aks-uat'
APP_LOGGING_LEVEL: 'INFO'
Expand Down Expand Up @@ -98,9 +98,9 @@ microservice-chart:
STATION_IN_GPD_PARTIAL_PATH: 'gpd-payments/api/v1'
RT_SEND_MAX_RETRIES: '5'
RT_SEND_SCHEDULING_TIME_IN_MINUTES: '60'
RT_SEND_AVOID_SCHEDULING_ON_STATES: 'PAA_RT_DUPLICATA'
RT_SEND_NO_DEAD_LETTER_ON_STATES: 'PAA_ID_DOMINIO_ERRATO,PAA_ID_INTERMEDIARIO_ERRATO,PAA_STAZIONE_INT_ERRATA,PAA_PAGAMENTO_SCONOSCIUTO,PAA_PAGAMENTO_DUPLICATO,PAA_PAGAMENTO_IN_CORSO,PAA_PAGAMENTO_ANNULLATO,PAA_PAGAMENTO_SCADUTO,PAA_SYSTEM_ERROR'
RPT_TIMER_QUEUE_NAME: "nodo_wisp_rpt_timeout_queue"
CRON_JOB_SCHEDULE_RECOVERY_ENABLED: 'true'
CRON_JOB_SCHEDULE_RECOVERY_ENABLED: 'false'
CRON_JOB_SCHEDULE_RECOVERY_RECEIPT_KO_ENABLED: '0 0 * * * *' # top of every hour of every day
CRON_JOB_SCHEDULE_RECOVERY_FROM_HOURS_AGO: '2' # from 2 hours ago
CRON_JOB_SCHEDULE_RECOVERY_UNTIL_HOURS_AGO: '1' # until 1 hours ago
Expand All @@ -118,7 +118,7 @@ microservice-chart:
SPRING_PROFILES_ACTIVE: "default,jsonLog"
secretProvider:
create: true
envSecrets:
envSecrets: &envSecret
# required
APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string'
SERVICE_BUS_PAYMENT_TIMEOUT_QUEUE_CONNECTION_STRING: 'wisp-payment-timeout-queue-connection-string'
Expand Down Expand Up @@ -170,3 +170,38 @@ microservice-chart:
pullPolicy: Always
envConfig: {}
envSecret: {}
# 1 - wisp converter service
app:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
resources:
!!merge <<: *resources
envConfig:
!!merge <<: *envConfig
envSecret:
!!merge <<: *envSecret
# 2 - wisp converter cron
cron:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
path: /pagopa-wisp-converter-notused/(.*)
resources:
!!merge <<: *resources
requests:
memory: "256Mi"
cpu: "0.15"
limits:
memory: "768Mi"
cpu: "0.25"
autoscaling:
enable: true
minReplica: 1
maxReplica: 1
envConfig:
!!merge <<: *envConfig
CRON_JOB_SCHEDULE_RECOVERY_ENABLED: 'true'
DISABLE_SERVICE_BUS_RECEIVER: 'true'
envSecret:
!!merge <<: *envSecret
124 changes: 104 additions & 20 deletions openapi/openapi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion openapi/openapi_redirect.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "WISP-Converter-redirect",
"version": "0.4.4-3-release-v0.4.x"
"version": "0.4.6"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>wisp-converter</artifactId>
<version>0.4.4-3-release-v0.4.x</version>
<version>0.4.6</version>
<name>pagoPA WISP Converter</name>
<description>A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.springframework.web.ErrorResponse;
import org.springframework.web.bind.annotation.*;

import static it.gov.pagopa.wispconverter.util.CommonUtility.sanitizeInput;

@RestController
@RequestMapping("/recovery")
@Validated
Expand Down Expand Up @@ -98,7 +100,7 @@ public ResponseEntity<RecoveryReceiptResponse> recoverReceiptKOForCreditorInstit
@PostMapping(value = "/receipts")
public ResponseEntity<RecoveryReceiptReportResponse> recoverReceiptToBeReSent(@RequestBody RecoveryReceiptRequest request) {
try {
log.info("Invoking API operation recoverReceiptToBeReSent - args: {}", request);
log.info("Invoking API operation recoverReceiptToBeReSent - args: {}", sanitizeInput(request.toString()));
return ResponseEntity.ok(recoveryService.recoverReceiptToBeReSent(request));
} catch (Exception ex) {
String operationId = MDC.get(Constants.MDC_OPERATION_ID);
Expand All @@ -117,7 +119,7 @@ public ResponseEntity<RecoveryReceiptReportResponse> recoverReceiptToBeReSent(@R
@PostMapping(value = "/partitions")
public ResponseEntity<RecoveryReceiptReportResponse> recoverReceiptToBeReSentByPartition(@RequestBody RecoveryReceiptByPartitionRequest request) {
try {
log.info("Invoking API operation recoverReceiptToBeReSentByPartition - args: {}", request);
log.info("Invoking API operation recoverReceiptToBeReSentByPartition - args: {}", sanitizeInput(request.toString()));
return ResponseEntity.ok(recoveryService.recoverReceiptToBeReSentByPartition(request));
} catch (Exception ex) {
String operationId = MDC.get(Constants.MDC_OPERATION_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public enum AppErrorCodeMessageEnum {
RECEIPT_GENERATION_ANOMALY_ON_PROCESSING(1408, "Anomaly on receipt generation", "Error while generating receipt. The receipt, related to idempotency key [{0}], is of type [{1}] but the invoked endpoint require the send of a [{2}] receipt.", HttpStatus.CONFLICT, "An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because there is a mismatch between the type of the cached receipt and the kind of request made for generate the same receipt. For example, the cached receipt is defined as negative paaInviaRT but the request was made to 'receipt/ok' endpoint. This is an anomaly that should never happens in a correct NMU flow execution but must be traced in case of error."),
RECEIPT_KO_NOT_GENERATED_BUT_MAYBE_RESCHEDULED(1409, "KO Receipt not generated", "Error while generating KO receipt. It is not possible to generate the receipt and it could be scheduled for a next send.", HttpStatus.UNPROCESSABLE_ENTITY, "An error occurred while generating a negative RT (aka a KO receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs."),
RECEIPT_OK_NOT_GENERATED_BUT_MAYBE_RESCHEDULED(1410, "OK Receipt not generated", "Error while generating OK receipt. It is not possible to generate the receipt and it could be scheduled for a next send.", HttpStatus.UNPROCESSABLE_ENTITY, "An error occurred while generating a positive RT (aka a OK receipt). The receipt could be sent lately to creditor institution but for better understanding the cause, please use the Technical Support's APIs."),
RECEIPT_GENERATION_ERROR_DEAD_LETTER(1411, "Receipt generation not completed", "Error while generating receipt. The creditor institution sent an error response related to the sent RT: [Outcome: {0}, Fault code: {1}, Fault string: {2}, Fault description: {3}].", HttpStatus.UNPROCESSABLE_ENTITY, "An error occurred while generating an RT (aka a receipt). Specifically, the creditor institution response status has not been recognized, for this reason the RT has been placed in the dead letter container."),
// --- DB and storage interaction errors ---
PERSISTENCE_SAVING_RE_ERROR(2000, "Impossible to save event", "Error while trying to store an event in Registro Eventi. Impossible to store event: {0}.", HttpStatus.INTERNAL_SERVER_ERROR, "An error occurred wile trying to store a new event in the Registro Eventi storage. The error is somewhat related to a persistence problem of the used storage and in the majority of the cases is temporary (maybe a 429 HTTP code). This error currently blocks the entire flow because that can lead to untraceable requests. For better understanding the cause, please execute a search in the log provider (Application Insights, Kibana, etc)."),
PERSISTENCE_RPT_NOT_FOUND(2001, "RPT not found", "Error while retrieving RPT. RPT with sessionId [{0}] not found.", HttpStatus.NOT_FOUND, "An error occurred while trying to retrieve the RPT content saved in storage by WISP SOAP Converter. This can be related either with the use of a wrong sessionId or a missed persistence from WISP SOAP Converter, so it is better to analyze the entire flow using Technical Support's APIs. This block totally the conversion of the RPTs in GPD's payment positions, so the whole process is discarded."),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package it.gov.pagopa.wispconverter.repository;

import com.azure.spring.data.cosmos.repository.CosmosRepository;
import it.gov.pagopa.wispconverter.repository.model.ReceiptDeadLetterEntity;
import org.springframework.stereotype.Repository;

@Repository
public interface ReceiptDeadLetterRepository extends CosmosRepository<ReceiptDeadLetterEntity, String> {

}
Loading

0 comments on commit 78e6723

Please sign in to comment.