diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 2d5a50f0..0ea78954 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ 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.287.0 -appVersion: 1.0.1 +version: 0.289.0 +appVersion: 1.0.3 dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 18d51cf8..bc28dc9d 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "1.0.1" + tag: "1.0.3" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index e3f7140c..de5f1207 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "1.0.1" + tag: "1.0.3" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index fd49580d..60b1a6a1 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: µservice-chart fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-wisp-converter - tag: "1.0.1" + tag: "1.0.3" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi-client/gpd/openapi.json b/openapi-client/gpd/openapi.json index 7214aa50..4951dc43 100644 --- a/openapi-client/gpd/openapi.json +++ b/openapi-client/gpd/openapi.json @@ -4,16 +4,12 @@ "title": "PagoPA API Debt Position", "description": "Progetto Gestione Posizioni Debitorie", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.11.28" + "version": "0.11.55" }, "servers": [ { - "url": "https://api.uat.platform.pagopa.it/gpd/api/v1/", - "description": "Test environment" - }, - { - "url": "https://api.platform.pagopa.it/gpd/api/v1/", - "description": "Production environment" + "url": "http://localhost", + "description": "Generated server url" } ], "tags": [ @@ -54,17 +50,6 @@ } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, "403": { "description": "Forbidden.", "headers": { @@ -93,6 +78,17 @@ } } } + }, + "401": { + "description": "Wrong or missing function key.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } } }, "security": [ @@ -138,21 +134,22 @@ "description": "Number of elements on one page. Default = 50", "required": false, "schema": { - "maximum": 100, + "maximum": 50, "type": "integer", "format": "int32", - "default": 50 + "default": 10 } }, { "name": "page", "in": "query", "description": "Page number. Page value starts from 0", - "required": true, + "required": false, "schema": { "minimum": 0, "type": "integer", - "format": "int32" + "format": "int32", + "default": 0 } }, { @@ -246,8 +243,8 @@ } ], "responses": { - "200": { - "description": "Obtained all organization payment positions.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -259,13 +256,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionsInfo" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Malformed request.", + "200": { + "description": "Obtained all organization payment positions.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -277,18 +274,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "$ref": "#/components/schemas/PaymentPositionsInfo" } } } @@ -321,6 +307,17 @@ } } } + }, + "401": { + "description": "Wrong or missing function key.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } } }, "security": [ @@ -369,19 +366,8 @@ "required": true }, "responses": { - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "500": { - "description": "Service unavailable.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -398,8 +384,8 @@ } } }, - "200": { - "description": "Debt Positions updated.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -407,10 +393,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -427,8 +420,8 @@ } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Debt Positions updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -436,11 +429,15 @@ "type": "string" } } - }, - "content": { - "application/json": { + } + }, + "401": { + "description": "Wrong or missing function key.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", "schema": { - "$ref": "#/components/schemas/ProblemJson" + "type": "string" } } } @@ -484,8 +481,8 @@ "required": true }, "responses": { - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -493,10 +490,13 @@ "type": "string" } } + }, + "content": { + "application/json": {} } }, - "409": { - "description": "Payment Position not found.", + "200": { + "description": "Debt Positions deleted.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -506,11 +506,15 @@ } }, "content": { - "application/json": {} + "application/json": { + "schema": { + "type": "string" + } + } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "Payment Position not found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -523,8 +527,8 @@ "application/json": {} } }, - "200": { - "description": "Debt Positions updated.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -532,13 +536,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "type": "string" - } - } } }, "400": { @@ -565,6 +562,16 @@ } ] }, + "parameters": [ + { + "name": "X-Request-Id", + "in": "header", + "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema": { + "type": "string" + } + } + ], "post": { "tags": [ "Debt Positions API" @@ -589,6 +596,21 @@ "type": "boolean", "default": false } + }, + { + "name": "serviceType", + "in": "query", + "description": "The field must not be considered as its value is set via the API Management (APIM) policy", + "required": false, + "schema": { + "type": "string", + "default": "GPD", + "enum": [ + "ACA", + "WISP", + "GPD" + ] + } } ], "requestBody": { @@ -620,8 +642,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -629,6 +651,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, "201": { @@ -660,8 +689,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -669,13 +698,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -687,17 +709,7 @@ "Authorization": [] } ] - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] + } }, "/organizations/{organizationfiscalcode}/debtpositions/{iupd}": { "get": { @@ -713,6 +725,7 @@ "description": "Organization fiscal code, the fiscal code of the Organization.", "required": true, "schema": { + "pattern": "[\\w*\\h-]+", "type": "string" } }, @@ -722,6 +735,7 @@ "description": "IUPD (Unique identifier of the debt position). Format could be `` this would make it unique within the new PD management system. It's the responsibility of the EC to guarantee uniqueness. The pagoPa system shall verify that this is `true` and if not, notify the EC.", "required": true, "schema": { + "pattern": "[\\w*\\h-]+", "type": "string" } } @@ -745,8 +759,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -754,10 +768,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "404": { - "description": "No debt position found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -765,17 +786,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -848,8 +862,8 @@ "required": true }, "responses": { - "200": { - "description": "Debt Position updated.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -861,13 +875,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Malformed request.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -884,8 +898,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "200": { + "description": "Debt Position updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -893,10 +907,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentPositionModel" + } + } } }, - "404": { - "description": "No debt position found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -913,8 +934,8 @@ } } }, - "409": { - "description": "Conflict: existing related payment found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -922,17 +943,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -972,6 +986,7 @@ "description": "Organization fiscal code, the fiscal code of the Organization.", "required": true, "schema": { + "pattern": "[\\w*\\h-]+", "type": "string" } }, @@ -981,6 +996,7 @@ "description": "IUPD (Unique identifier of the debt position). Format could be `` this would make it unique within the new PD management system. It's the responsibility of the EC to guarantee uniqueness. The pagoPa system shall verify that this is `true` and if not, notify the EC.", "required": true, "schema": { + "pattern": "[\\w*\\h-]+", "type": "string" } } @@ -1004,8 +1020,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1013,10 +1029,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "404": { - "description": "No debt position position found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1033,8 +1056,8 @@ } } }, - "409": { - "description": "Conflict: existing related payment found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1042,17 +1065,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1136,8 +1152,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "409": { + "description": "Conflict: debt position is not in invalidable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1145,10 +1161,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "404": { - "description": "No debt position found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1165,8 +1188,8 @@ } } }, - "409": { - "description": "Conflict: debt position is not in invalidable state.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1174,17 +1197,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1250,8 +1266,8 @@ } ], "responses": { - "200": { - "description": "Request published.", + "409": { + "description": "Conflict: debt position is not in publishable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1263,13 +1279,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Wrong or missing function key.", + "200": { + "description": "Request published.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1277,10 +1293,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentPositionModel" + } + } } }, - "404": { - "description": "No debt position found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1297,8 +1320,8 @@ } } }, - "409": { - "description": "Conflict: debt position is not in publishable state.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1306,17 +1329,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1378,14 +1394,14 @@ "description": "Payment Option IUV", "required": true, "schema": { - "pattern": "^\\d{1,30}$", + "pattern": "\\b\\w{0,35}\\b", "type": "string" } } ], "responses": { - "200": { - "description": "Debt Positions updated.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1395,15 +1411,11 @@ } }, "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" - } - } + "application/json": {} } }, - "400": { - "description": "Malformed request.", + "429": { + "description": "Too many requests.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1411,13 +1423,10 @@ "type": "string" } } - }, - "content": { - "application/json": {} } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "Payment Position not found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1425,10 +1434,13 @@ "type": "string" } } + }, + "content": { + "application/json": {} } }, - "404": { - "description": "Payment Position not found.", + "200": { + "description": "Debt Positions updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1438,11 +1450,15 @@ } }, "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" + } + } } }, - "429": { - "description": "Too many requests.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1452,8 +1468,8 @@ } } }, - "500": { - "description": "Service unavailable.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1560,8 +1576,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1569,6 +1585,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, "404": { @@ -1589,8 +1612,8 @@ } } }, - "409": { - "description": "Conflict: existing related payment found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1607,8 +1630,8 @@ } } }, - "500": { - "description": "Service unavailable.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1616,13 +1639,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -1660,6 +1676,7 @@ "description": "Organization fiscal code, the fiscal code of the Organization.", "required": true, "schema": { + "pattern": "\\d{1,30}", "type": "string" } }, @@ -1669,6 +1686,7 @@ "description": "NAV (notice number) is the unique reference assigned to the payment by a creditor institution.", "required": true, "schema": { + "pattern": "^\\d{1,30}$", "type": "string" } } @@ -1692,8 +1710,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1701,10 +1719,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "404": { - "description": "No payment option found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1712,17 +1737,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1798,8 +1816,8 @@ "required": true }, "responses": { - "200": { - "description": "Request updated.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1811,13 +1829,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentsModelResponse" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "209": { - "description": "Request updated with a payment in progress.", + "200": { + "description": "Request updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1834,8 +1852,8 @@ } } }, - "400": { - "description": "Malformed request.", + "209": { + "description": "Request updated with a payment in progress.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1847,13 +1865,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentsModelResponse" } } } }, - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1861,10 +1879,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "404": { - "description": "No payment option found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1872,13 +1897,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, "422": { @@ -1899,8 +1917,8 @@ } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1976,8 +1994,8 @@ "required": true }, "responses": { - "200": { - "description": "Request paid.", + "422": { + "description": "Unprocessable: not in payable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1989,7 +2007,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentsModelResponse" + "$ref": "#/components/schemas/ProblemJson" } } } @@ -2012,8 +2030,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2021,10 +2039,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "404": { - "description": "No payment option found.", + "200": { + "description": "Request paid.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2036,13 +2061,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentsModelResponse" } } } }, - "409": { - "description": "Conflict: existing related payment found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2059,8 +2084,8 @@ } } }, - "422": { - "description": "Unprocessable: not in payable state.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2068,17 +2093,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2263,6 +2281,9 @@ "organizationFiscalCode": { "type": "string" }, + "companyName": { + "type": "string" + }, "idTransfer": { "type": "string" }, @@ -2317,8 +2338,10 @@ "type": "object", "properties": { "hashDocument": { + "maxLength": 72, + "minLength": 0, "type": "string", - "description": "Document hash" + "description": "Document hash type is stBase64Binary72 as described in https://github.com/pagopa/pagopa-api." }, "stampType": { "maxLength": 2, @@ -2489,10 +2512,12 @@ }, "country": { "pattern": "[A-Z]{2}", - "type": "string" + "type": "string", + "example": "IT" }, "email": { - "type": "string" + "type": "string", + "example": "email@domain.com" }, "phone": { "type": "string" @@ -2522,9 +2547,6 @@ "format": "date-time", "readOnly": true }, - "pull": { - "type": "boolean" - }, "status": { "type": "string", "readOnly": true, @@ -2609,6 +2631,11 @@ "stamp": { "$ref": "#/components/schemas/Stamp" }, + "companyName": { + "maxLength": 140, + "minLength": 0, + "type": "string" + }, "transferMetadata": { "maxItems": 10, "minItems": 0, @@ -2792,37 +2819,6 @@ } } }, - "PageInfo": { - "required": [ - "items_found", - "limit", - "page", - "total_pages" - ], - "type": "object", - "properties": { - "page": { - "type": "integer", - "description": "Page number", - "format": "int32" - }, - "limit": { - "type": "integer", - "description": "Required number of items per page", - "format": "int32" - }, - "items_found": { - "type": "integer", - "description": "Number of items found. (The last page may have fewer elements than required)", - "format": "int32" - }, - "total_pages": { - "type": "integer", - "description": "Total number of pages", - "format": "int32" - } - } - }, "PaymentOptionModelResponse": { "type": "object", "properties": { @@ -2928,9 +2924,6 @@ "G" ] }, - "pull": { - "type": "boolean" - }, "companyName": { "type": "string" }, @@ -2978,30 +2971,15 @@ } } }, - "PaymentPositionsInfo": { - "required": [ - "page_info", - "payment_position_list" - ], - "type": "object", - "properties": { - "payment_position_list": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" - } - }, - "page_info": { - "$ref": "#/components/schemas/PageInfo" - } - } - }, "TransferModelResponse": { "type": "object", "properties": { "organizationFiscalCode": { "type": "string" }, + "companyName": { + "type": "string" + }, "idTransfer": { "type": "string" }, @@ -3047,6 +3025,55 @@ } } }, + "PageInfo": { + "required": [ + "items_found", + "limit", + "page", + "total_pages" + ], + "type": "object", + "properties": { + "page": { + "type": "integer", + "description": "Page number", + "format": "int32" + }, + "limit": { + "type": "integer", + "description": "Required number of items per page", + "format": "int32" + }, + "items_found": { + "type": "integer", + "description": "Number of items found. (The last page may have fewer elements than required)", + "format": "int32" + }, + "total_pages": { + "type": "integer", + "description": "Total number of pages", + "format": "int32" + } + } + }, + "PaymentPositionsInfo": { + "required": [ + "page_info", + "payment_position_list" + ], + "type": "object", + "properties": { + "payment_position_list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" + } + }, + "page_info": { + "$ref": "#/components/schemas/PageInfo" + } + } + }, "AppInfo": { "type": "object", "properties": { diff --git a/openapi/openapi.json b/openapi/openapi.json index 92a00d8c..ad66ae2f 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.\n\n# OPERATIVE INFO\n\n\n## EVENT MAPPING IN RE\n\n
Details\nFIELD | SCOPE | DESCRIPTION\n- | - | -\n**requestId** | BOTH | The identifier, set by X-Request-ID, from which the events can be grouped.\n**operationId** | BOTH | The identifier associated to a request identifier\n**clientOperationId** | BOTH | The identifier that associate a client to an operation identifier.\n**component** | BOTH | The applicative component from which the event is generated.
In NDP it is mapped with field 'componente'.
Values:
_WISP_SOAP_CONVERTER_
_WISP_CONVERTER_\n**insertedTimestamp** | BOTH | The time on which the event is inserted in RE storage\n**eventCategory** | BOTH | The category on which the event can be grouped.
In NDP it is mapped with field 'categoriaEvento'.
Values:
_INTERFACE_
_INTERNAL_\n**eventSubcategory** | BOTH | The subcategory related to the specific nature of the event.
In NDP it is mapped with field 'sottoTipoEvento'.
Values:
_REQ_
_RESP_
_INTERN_\n**callType** | INTERFACE | The type of role that the application has in the communication with the remote endpoint.
Values:
_SERVER_
_CLIENT_\n**outcome** | INTERFACE | The outcome of the operation described by the event.
In NDP it is mapped with field 'esito'.
Values:
_SEND_: Correctly sent request to HTTP endpoint. In NDP it is mapped with value 'INVIATA'.
_SEND_FAILURE_: Failed to send request to HTTP endpoint. In NDP it is mapped with value 'INVIATA_KO'
_RECEIVED_: Received an OK response from HTTP endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_RECEIVED_FAILURE_: Received a failure response from endpoint. In NDP it is mapped with value 'RICEVUTA_KO'
_NEVER_RECEIVED_: Failed to receive response at all from endpoint. In NDP it is mapped with value 'NO_RICEVUTA'
_EXECUTED_INTERNAL_STEP_: Executed internal step on execution. In NDP it is mapped with value 'CAMBIO_STATO'\n**httpMethod** | INTERFACE | The HTTP method of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpUri** | INTERFACE | The URI related to the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpHeaders** | INTERFACE | The list of HTTP headers extracted from the request/response analyzed by the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpCallRemoteAddress** | INTERFACE | The remote IP address extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**httpStatusCode** | INTERFACE | The status code extracted from the called endpoint.
This field is set only if the events that describe an HTTP communication with an external service.\n**executionTimeMs** | INTERFACE | The duration time of the invocation of the endpoint related to the event.
This field is set only if the events that describe an HTTP communication with an external service.\n**compressedPayload** | INTERFACE | The payload of the request/response analyzed by the event.
This value is zipped using GZip compression algorithm.\n**compressedPayloadLength** | INTERFACE | The length (in number of characters) of the compressed payload.\n**businessProcess** | INTERFACE | The descriptive label associated to the endpoint called by user and related to the whole process.\n**operationStatus** | INTERFACE | The final status of the whole operation.
This is set only in the events that describe the response in output to user.\n**operationErrorTitle** | INTERFACE | The error title extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorDetail** | INTERFACE | The error detail message extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**operationErrorCode** | INTERFACE | The error code extracted from the computation that refers to the error occurred during computation.
This is set only in the events that describe the response in output to user if there is an error.\n**primitive** | INTERNAL | The typology of primitive analyzed and tracked by the event.
In NDP it is mapped with field 'eventType'.\n**sessionId** | INTERNAL | The session identifier generated by WISP SOAP Converter and used in the request.\n**cartId** | INTERNAL | The cart identifier used in the request.\n**iuv** | INTERNAL | The 'identificativo univoco pagamento' used in the request.\n**noticeNumber** | INTERNAL | The notice number (aka NAV code) used in the request.\n**domainId** | INTERNAL | The creditor institution identifier used in the request.\n**ccp** | INTERNAL | The 'codice contesto pagamento' used in the request.\n**psp** | INTERNAL | The payment service provider used in the request.\n**station** | INTERNAL | The station used in the request.\n**channel** | INTERNAL | The channel used in the request.\n**status** | INTERNAL | The state of the internal step executed.
Values:
_FOUND_RPT_IN_STORAGE_
_FOUND_RT_IN_STORAGE_
_EXTRACTED_DATA_FROM_RPT_
_CREATED_NEW_PAYMENT_POSITION_IN_GPD_
_GENERATED_NAV_FOR_NEW_PAYMENT_POSITION_
_UPDATED_EXISTING_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_INVALID_PAYMENT_POSITION_IN_GPD_
_GENERATING_RT_FOR_GPD_EXCEPTION_
_GENERATING_RT_FOR_REDIRECT_ERROR_
_GENERATED_CACHE_ABOUT_RPT_FOR_DECOUPLER_
_GENERATED_CACHE_ABOUT_RPT_FOR_CARTSESSION_CACHING_
_GENERATED_CACHE_ABOUT_RPT_FOR_RT_GENERATION_
_SAVED_RPT_IN_CART_RECEIVED_REDIRECT_URL_FROM_CHECKOUT_
_RT_NOT_GENERABLE_FOR_GPD_STATION_
_RT_NOT_GENERABLE_FOR_NOT_EXISTING_PAYMENT_POSITION_
_NEGATIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_POSITIVE_RT_TRY_TO_SEND_TO_CREDITOR_INSTITUTION_
_RT_SEND_SUCCESS_
_RT_SENT_OK_
_RT_SEND_FAILURE_
_RT_ALREADY_SENT_
_RT_SEND_SCHEDULING_SUCCESS_
_RT_SEND_SCHEDULING_FAILURE_
_RT_SCHEDULED_SEND_SUCCESS_
_RT_SCHEDULED_SEND_FAILURE_
_RT_SEND_RESCHEDULING_FAILURE_
_RT_SEND_RESCHEDULING_REACHED_MAX_RETRIES_
_RT_SEND_RESCHEDULING_SUCCESS_
_RT_RECONCILIATION_PROCESS_
_RT_START_RECONCILIATION_PROCESS_
_RT_END_RECONCILIATION_PROCESS_
_RT_DEAD_LETTER_SAVED_
_RT_DEAD_LETTER_FAILED_
_RECEIPT_TIMER_GENERATION_CREATED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_CACHED_SEQUENCE_NUMBER_
_RECEIPT_TIMER_GENERATION_DELETED_SCHEDULED_SEND_
_RECEIPT_TIMER_GENERATION_SKIP_DELETE_SCHEDULED_SEND_
_RECEIPT_TIMER_PAYMENT_TOKEN_TIMEOUT_TRIGGER_
_ECOMMERCE_HANG_TIMER_TRIGGER_
_ECOMMERCE_HANG_TIMER_CREATED_
_ECOMMERCE_HANG_TIMER_DELETED_
_RPT_TIMER_TRIGGER_
_RPT_TIMER_CREATED_
_RPT_TIMER_DELETED_
_RPT_TIMER_NOT_SET_
_COMMUNICATING_WITH_GPD_REQUEST_
_COMMUNICATING_WITH_GPD_RESPONSE_
_COMMUNICATING_WITH_IUV_GENERATOR_REQUEST_
_COMMUNICATING_WITH_IUV_GENERATOR_RESPONSE_
_COMMUNICATING_WITH_CHECKOUT_REQUEST_
_COMMUNICATING_WITH_CHECKOUT_RESPONSE_
_COMMUNICATING_WITH_DECOUPLER_CACHING_REQUEST_
_COMMUNICATING_WITH_DECOUPLER_CACHING_RESPONSE_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_REQUEST_
_COMMUNICATING_WITH_CREDITOR_INSTITUTION_RESPONSE_\n**info** | INTERNAL | The other information that can be inserted for the tracing.\n**paymentToken** | INTERNAL | The payment token.\n\n
\n\n\n## OPERATIONAL ERROR CODES\n\n
Details\nNAME | CODE | DESCRIPTION\n- | - | -\n**WIC-500** | *ERROR* | A not documented generic error occurred while execution. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1000** | *GENERIC_ERROR* | A generic error occurred while executing conversion flow. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1001** | *PARSING_GENERIC_ERROR* | A generic error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1002** | *PARSING_INVALID_HEADER* | An error occurred while parsing of the content header, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1003** | *PARSING_INVALID_BODY* | An error occurred while parsing of the content payload, associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT.\n**WIC-1004** | *PARSING_INVALID_XML_NODES* | An error occurred while parsing of the of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The XML content extracted, either from payload or from header, is invalid because it is not possible to extract tag nodes from document. So, the document is probably empty.\n**WIC-1005** | *PARSING_INVALID_ZIPPED_PAYLOAD* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The SOAP request analyzed and stored in dedicated storage is not usable for convert the debt positions in GPD system. This is probably due to an invalid conversion of the SOAP request via GZip algorithm executed before the same is stored in its storage.\n**WIC-1006** | *PARSING_RPT_PRIMITIVE_NOT_VALID* | An error occurred while parsing of the content associated to the SOAP request related to nodoInviaRPT or nodoInviaCarrelloRPT. The primitive (the content related to header 'soapaction') cannot be handled by WISP Converter application in redirect process: only one of nodoInviaRPT and nodoInviaCarrelloRPT can be accepted.\n**WIC-1100** | *VALIDATION_INVALID_MULTIBENEFICIARY_CART* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, the request is arrived as nodoInviaCarrelloRPT as multi-beneficiary cart, but the number of RPTs in the request is lower than two, so it cannot be correctly handled as multi-beneficiary.\n**WIC-1101** | *VALIDATION_INVALID_IBANS* | An error occurred while analyzing the RPTs extracted from SOAP request. An IBAN must always be set in RPT transfers if they aren't related to digital stamps (which don't require an IBAN, because they will be reported to specific subject). In this case, in one or more RPT transfers not related to digital stamp, the IBAN is not correctly set.\n**WIC-1102** | *VALIDATION_INVALID_DEBTOR* | An error occurred while analyzing the RPTs extracted from SOAP request. In particular, in a cart there are different debtor subjects and this is not permitted for this flow. So, the whole cart is discarded.\n**WIC-1200** | *CONFIGURATION_INVALID_CACHE* | An error occurred while trying to access data from cached configuration. It is possible that the cache is not retrieved yet by this service or a corrupted configuration was returned from APIConfig Cache internal service. If this problem still occurs, please check the connectivity with APIConfig Cache.\n**WIC-1201** | *CONFIGURATION_INVALID_STATION* | An error occurred while retrieving data from local cached configuration. In particular, it is not possible to retrieve the configuration about the station because it does not exists in cache, and maybe also in general configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1202** | *CONFIGURATION_INVALID_CREDITOR_INSTITUTION_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the required station does not exists in cached configuration. So, a change in whole configuration and/or a refresh on cache is required.\n**WIC-1203** | *CONFIGURATION_INVALID_STATION_REDIRECT_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration about redirection in error cases is not correctly set to points towards some creditor institution's endpoint. So, a change in configuration is required.\n**WIC-1204** | *CONFIGURATION_INVALID_STATION_SERVICE_URL* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint for RT generator. So, a change in configuration is required.\n**WIC-1205** | *CONFIGURATION_NOT_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is not correctly set to points towards GPD service endpoint. So, a change in configuration is required.\n**WIC-1206** | *CONFIGURATION_INVALID_GPD_STATION* | An error occurred while checking the station that will be used for the payment process. In particular, analyzing the station that is related to the segregation code extracted from a payment option's notice number, it turns out that the configuration is correctly set to points towards GPD service endpoint but uses the 'v1' primitive version (and it must use the 'v2' version). So, a change in configuration is required.\n**WIC-1207** | *CONFIGURATION_INVALID_STATION_PROXY* | An error occurred while checking the station that will be used for the receipt send process. In particular, analyzing the station it turns out that the configuration is not correctly set to configure proxy structure for RT generator. So, a change in configuration is required.\n**WIC-1300** | *PAYMENT_POSITION_NOT_IN_PAYABLE_STATE* | An error occurred while checking an existing payment position. One or more RPTs extracted from the request refers to existing payment positions in GPD that have a state from which it is impossible to execute a payment flow. If the execution of this flow is related to a RPT cart, all the payments that can be retrieved or generated ex novo from those RPTs are declared as atomically invalid (if one RPT in cart is bad, all RPTs in cart are bad) and not payable with this flow.\n**WIC-1301** | *PAYMENT_POSITION_IN_INCONSISTENT_STATE* | An error occurred while checking an existing payment position in GPD system. The retrieved payment position, previously inserted in GPD by this same flow or by other procedures, is in an invalid state, not mappable to an existing value. This can be related to a wrong setting in GPD or a corruption of the retrieved data.\n**WIC-1302** | *PAYMENT_POSITION_NOT_VALID* | An error occurred while generating a payment position. In particular, something during the generation of a new payment position or the analysis of an existing payment position went wrong and the operation cannot be completed. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1303** | *PAYMENT_OPTION_NOT_EXTRACTABLE* | An error occurred while extracting a payment option from a payment position. This can be caused by a malformed payment position that does not have a payment option. Remember that a payment position in this flow must have one and only one payment option.\n**WIC-1400** | *RECEIPT_GENERATION_GENERIC_ERROR* | An error occurred while generating an RT (aka a receipt). An unhandled error occurred and it is impossible to complete the process. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1401** | *RECEIPT_GENERATION_WRONG_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an invalid response from which is impossible to continue the analysis. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1402** | *RECEIPT_GENERATION_ERROR_RESPONSE_FROM_CREDITOR_INSTITUTION* | An error occurred while generating an RT (aka a receipt). Specifically, the RT request is sent to creditor institution but this one responded with an error response that explicit the occurred problem. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1403** | *RECEIPT_KO_NOT_SENT* | An error occurred while sending a negative RT (aka a KO receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1404** | *RECEIPT_OK_NOT_SENT* | An error occurred while sending a positive RT (aka a OK receipt). So, no receipt can be sent lately to creditor institution and probably the process must be executed manually. For better understanding the cause, please use the Technical Support's APIs.\n**WIC-1405** | *RECEIPT_GENERATION_IDEMPOTENCY_LOCKED_BY_ANOTHER_PROCESS* | An error occurred while generating an RT (aka a receipt). Two or more generation processes are concurrently trying to execute the same operation on the same receipt but only one of them is currently 'authorized' to do so.\n**WIC-1406** | *RECEIPT_GENERATION_NOT_PROCESSABLE* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be started correctly because it is trying to lock the idempotency key that is already in a locked state. Probably the process is in execution by another thread.\n**WIC-1407** | *RECEIPT_GENERATION_ALREADY_PROCESSED* | An error occurred while generating an RT (aka a receipt). The process of receipt generation cannot be completed correctly because it is trying to unlock the idempotency key that is not in a locked state. Probably the process was already completed.\n**WIC-1408** | *RECEIPT_GENERATION_ANOMALY_ON_PROCESSING* | 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.\n**WIC-1409** | *RECEIPT_KO_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | 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.\n**WIC-1410** | *RECEIPT_OK_NOT_GENERATED_BUT_MAYBE_RESCHEDULED* | 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.\n**WIC-1411** | *RECEIPT_GENERATION_ERROR_DEAD_LETTER* | 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.\n**WIC-2000** | *PERSISTENCE_SAVING_RE_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).\n**WIC-2001** | *PERSISTENCE_RPT_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.\n**WIC-2002** | *PERSISTENCE_RT_NOT_FOUND* | An error occurred while trying to retrieve the RT content saved in storage by WISP Converter. This can be related either with the use of a wrong identifier, a missed persistence or an expired object, so it is better to analyze the entire flow using Technical Support's APIs.\n**WIC-2003** | *PERSISTENCE_REQUESTID_CACHING_ERROR* | An error occurred while trying to retrieve data from internal cache. Specifically, the cached key, defined in format wisp_nav2iuv__
\n", "termsOfService": "https://www.pagopa.gov.it/", "title": "WISP Converter", - "version": "1.0.1" + "version": "1.0.3" }, "servers": [ { diff --git a/openapi/openapi_redirect.json b/openapi/openapi_redirect.json index a9335ad2..a3bbfa44 100644 --- a/openapi/openapi_redirect.json +++ b/openapi/openapi_redirect.json @@ -2,7 +2,7 @@ "openapi": "3.0.1", "info": { "title": "WISP-Converter-redirect", - "version": "1.0.1" + "version": "1.0.3" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 5235840b..374e6e19 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa wisp-converter - 1.0.1 + 1.0.3 pagoPA WISP Converter A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments. diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/CosmosDBConfig.java b/src/main/java/it/gov/pagopa/wispconverter/config/CosmosDBConfig.java index ba7eea4b..9b46243e 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/config/CosmosDBConfig.java +++ b/src/main/java/it/gov/pagopa/wispconverter/config/CosmosDBConfig.java @@ -15,11 +15,15 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; import org.springframework.lang.Nullable; @Configuration -@EnableCosmosRepositories("it.gov.pagopa.wispconverter.repository") +@EnableCosmosRepositories( + basePackages = "it.gov.pagopa.wispconverter.repository", + excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "it\\.gov\\.pagopa\\.wispconverter\\.repository\\.secondary\\..*")) @EnableConfigurationProperties @EnableCosmosAuditing @ConditionalOnExpression("'${info.properties.environment}'!='test'") diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/SecondaryCosmosConfig.java b/src/main/java/it/gov/pagopa/wispconverter/config/SecondaryCosmosConfig.java index d2ea7b06..981aecfb 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/config/SecondaryCosmosConfig.java +++ b/src/main/java/it/gov/pagopa/wispconverter/config/SecondaryCosmosConfig.java @@ -18,7 +18,7 @@ import java.util.List; @Configuration -@EnableCosmosRepositories(basePackages = "it.gov.pagopa.wispconverter.secondary") +@EnableCosmosRepositories(basePackages = "it.gov.pagopa.wispconverter.repository.secondary") @EnableConfigurationProperties @ConditionalOnExpression("'${info.properties.environment}'!='test'") @Slf4j diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/DebtPositionService.java b/src/main/java/it/gov/pagopa/wispconverter/service/DebtPositionService.java index 7036afc9..c8229d93 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/DebtPositionService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/DebtPositionService.java @@ -16,7 +16,6 @@ import it.gov.pagopa.wispconverter.util.CommonUtility; import it.gov.pagopa.wispconverter.util.Constants; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.util.Pair; @@ -32,7 +31,6 @@ import java.util.stream.Collectors; @Service -@Slf4j @RequiredArgsConstructor public class DebtPositionService { @@ -44,10 +42,6 @@ public class DebtPositionService { private final ReService reService; - private final ReceiptService receiptService; - - private final DecouplerService decouplerService; - private final ConfigCacheService configCacheService; private final DebtPositionMapper mapper; @@ -526,8 +520,8 @@ private void handlePaymentPositionInsertion(DebtPositionsApiApi gpdClientInstanc it.gov.pagopa.gen.wispconverter.client.gpd.model.MultiplePaymentPositionModelDto multiplePaymentPositions = new MultiplePaymentPositionModelDto(); multiplePaymentPositions.setPaymentPositions(paymentPositionsToCreateForCreditorInstitution); - // communicating with GPD service in order to update the existing payment position - gpdClientInstance.createMultiplePositions(creditorInstitutionId, multiplePaymentPositions, MDC.get(Constants.MDC_REQUEST_ID), true); + // communicating with GPD service in order to update the existing payment position (serviceType WISP) + gpdClientInstance.createMultiplePositions(creditorInstitutionId, multiplePaymentPositions, MDC.get(Constants.MDC_REQUEST_ID), true, "WISP"); } } catch (RestClientException e) { diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/IdempotencyService.java b/src/main/java/it/gov/pagopa/wispconverter/service/IdempotencyService.java index 8e5159ac..6d0941c5 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/IdempotencyService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/IdempotencyService.java @@ -30,23 +30,31 @@ public static String generateIdempotencyKeyId(String sessionId, String iuv, Stri } public boolean isIdempotencyKeyProcessable(String idempotencyKey, ReceiptTypeEnum receiptType) { - boolean isProcessable = true; - // try to retrieve idempotency key entity from the storage and check if exists Optional optIdempotencyKeyEntity = idempotencyKeyRepository.findById(idempotencyKey); - if (optIdempotencyKeyEntity.isPresent()) { - /* - Check if receipt type (set in idempotency key) is equals to the one defined in the receipt entity. - If they are not equals it is an anomaly, so throw a dedicated exception - */ + if (optIdempotencyKeyEntity.isPresent()) { + // Check if receipt type (set in idempotency key) is equals to the one defined in the receipt entity. IdempotencyKeyEntity idempotencyKeyEntity = optIdempotencyKeyEntity.get(); - if (!receiptType.equals(idempotencyKeyEntity.getReceiptType())) { + ReceiptTypeEnum receiptTypeSent = idempotencyKeyEntity.getReceiptType(); + + if(receiptType.equals(ReceiptTypeEnum.OK) && receiptTypeSent.equals(ReceiptTypeEnum.KO)) { + // if coming receipt is OK and sent receipt is KO -> reset idempotency key (ie force receipt-ok sending) + idempotencyKeyEntity.setStatus(IdempotencyStatusEnum.FAILED); + idempotencyKeyEntity.setLockedAt(null); + idempotencyKeyEntity.setReceiptType(ReceiptTypeEnum.OK); + idempotencyKeyRepository.save(idempotencyKeyEntity); + } else if(receiptType.equals(ReceiptTypeEnum.KO) && receiptTypeSent.equals(ReceiptTypeEnum.OK)) { + // if coming receipt is KO and sent receipt is OK -> do nothing, it is an anomaly, so throw a dedicated exception throw new AppException(AppErrorCodeMessageEnum.RECEIPT_GENERATION_ANOMALY_ON_PROCESSING, idempotencyKey, idempotencyKeyEntity.getReceiptType(), receiptType); + } else { + // same type between coming receipt and sent receipt [(OK,OK), (KO,KO)] -> do nothing + log.warn("Attempt to send a receipt of the same type (incoming receipt request {}, receipt type {} sent already) " + + "will not be completed if it is locked or already successfully done.", receiptType, receiptTypeSent); } - // check the processability of the idempotency key + // check if the idempotency key is processable isProcessable = !IdempotencyStatusEnum.SUCCESS.equals(idempotencyKeyEntity.getStatus()) && isActiveLockExpired(idempotencyKeyEntity) || IdempotencyStatusEnum.FAILED.equals(idempotencyKeyEntity.getStatus()); } return isProcessable; diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/ReceiptService.java b/src/main/java/it/gov/pagopa/wispconverter/service/ReceiptService.java index 015a05d4..2f606597 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/ReceiptService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/ReceiptService.java @@ -87,9 +87,7 @@ public class ReceiptService { private final ServiceBusService serviceBusService; private final ReceiptDeadLetterRepository receiptDeadLetterRepository; - - private final it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient; - + @Autowired private final it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClientWithRetry; diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/mapper/DebtPositionMapper.java b/src/main/java/it/gov/pagopa/wispconverter/service/mapper/DebtPositionMapper.java index fcb76624..4d036af9 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/mapper/DebtPositionMapper.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/mapper/DebtPositionMapper.java @@ -24,7 +24,6 @@ public interface DebtPositionMapper { @Mapping(target = "validityDate", expression = "java(null)") @Mapping(target = "switchToExpired", constant = "false") @Mapping(target = "payStandIn", constant = "false") - @Mapping(target = "pull", constant = "false") it.gov.pagopa.gen.wispconverter.client.gpd.model.PaymentPositionModelDto toPaymentPosition(RPTContentDTO rptContentDTO); @Mapping(source = "commonFields.payerType", target = "type") diff --git a/src/test/java/it/gov/pagopa/wispconverter/endpoint/CarrelloTest.java b/src/test/java/it/gov/pagopa/wispconverter/endpoint/CarrelloTest.java index e3a3a362..5316731a 100644 --- a/src/test/java/it/gov/pagopa/wispconverter/endpoint/CarrelloTest.java +++ b/src/test/java/it/gov/pagopa/wispconverter/endpoint/CarrelloTest.java @@ -61,6 +61,7 @@ class CarrelloTest { @MockBean private it.gov.pagopa.gen.wispconverter.client.cache.invoker.ApiClient cacheClient; @MockBean + @Qualifier("decouplerCachingClient") private it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient; @Qualifier("redisSimpleTemplate") @MockBean diff --git a/src/test/java/it/gov/pagopa/wispconverter/endpoint/ReceiptTest.java b/src/test/java/it/gov/pagopa/wispconverter/endpoint/ReceiptTest.java index e4518550..9c179ca4 100644 --- a/src/test/java/it/gov/pagopa/wispconverter/endpoint/ReceiptTest.java +++ b/src/test/java/it/gov/pagopa/wispconverter/endpoint/ReceiptTest.java @@ -12,6 +12,7 @@ import it.gov.pagopa.wispconverter.repository.ReceiptDeadLetterRepository; import it.gov.pagopa.wispconverter.repository.model.RPTRequestEntity; import it.gov.pagopa.wispconverter.service.*; +import it.gov.pagopa.wispconverter.service.mapper.RTMapper; import it.gov.pagopa.wispconverter.service.model.ReceiptDto; import it.gov.pagopa.wispconverter.utils.TestUtils; import lombok.SneakyThrows; @@ -19,6 +20,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; @@ -65,8 +67,11 @@ class ReceiptTest { private NavToIuvMappingRepository navToIuvMappingRepository; @MockBean private ReService reService; + @MockBean + private RTMapper rtMapper; @MockBean + @Qualifier("decouplerCachingClient") private it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient; private String getPaSendRTPayload() { diff --git a/src/test/java/it/gov/pagopa/wispconverter/endpoint/RptTest.java b/src/test/java/it/gov/pagopa/wispconverter/endpoint/RptTest.java index 3a997ee0..bd479478 100644 --- a/src/test/java/it/gov/pagopa/wispconverter/endpoint/RptTest.java +++ b/src/test/java/it/gov/pagopa/wispconverter/endpoint/RptTest.java @@ -72,6 +72,7 @@ class RptTest { @MockBean private it.gov.pagopa.gen.wispconverter.client.cache.invoker.ApiClient cacheClient; @MockBean + @Qualifier("decouplerCachingClient") private it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient; @Qualifier("redisSimpleTemplate") @MockBean