diff --git a/integration-test/src/step_definitions/support/clients/gpd_client.js b/integration-test/src/step_definitions/support/clients/gpd_client.js index b246cee0..a855a37f 100644 --- a/integration-test/src/step_definitions/support/clients/gpd_client.js +++ b/integration-test/src/step_definitions/support/clients/gpd_client.js @@ -1,4 +1,4 @@ -const { get, post, del, put } = require("../utility/axios_common"); +const { get, post, del, put, patch } = require("../utility/axios_common"); const fs = require("fs"); const GPD_HOST = process.env.gpd_host; @@ -208,7 +208,7 @@ function updateAndPublishDebtPosition(orgId, iupd, body) { } function updateTransferIbanMassive(orgId, oldIban, newIban) { - return post(GPD_HOST + `/organizations/${orgId}/transfers/update/iban`, {oldIban, newIban}, { + return patch(GPD_HOST + `/organizations/${orgId}/transfers?oldIban=${oldIban}`, {newIban}, { timeout: API_TIMEOUT, headers: { "Ocp-Apim-Subscription-Key": process.env.API_SUBSCRIPTION_KEY, diff --git a/integration-test/src/step_definitions/support/utility/axios_common.js b/integration-test/src/step_definitions/support/utility/axios_common.js index f56875a4..b72db418 100644 --- a/integration-test/src/step_definitions/support/utility/axios_common.js +++ b/integration-test/src/step_definitions/support/utility/axios_common.js @@ -21,6 +21,16 @@ function post(url, body, config) { }); } +function patch(url, body, config) { + return axios.patch(url, body, config) + .then(res => { + return res; + }) + .catch(error => { + return error.response; + }); +} + function put(url, body, config) { return axios.put(url, body, config) .then(res => { @@ -42,4 +52,4 @@ function del(url, config) { }); } -module.exports = {get, post, put, del} \ No newline at end of file +module.exports = {get, post, patch, put, del} \ No newline at end of file diff --git a/openapi/openapi_external.json b/openapi/openapi_external.json index 8cbc3b12..84c075e0 100644 --- a/openapi/openapi_external.json +++ b/openapi/openapi_external.json @@ -191,8 +191,8 @@ } } }, - "429": { - "description": "Too many requests.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -220,8 +220,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "429": { + "description": "Too many requests.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -314,8 +314,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -323,17 +323,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "201": { - "description": "Request created.", + "409": { + "description": "Conflict: duplicate debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -345,13 +338,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -359,10 +352,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: duplicate debt position found.", + "201": { + "description": "Request created.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -374,7 +374,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModel" } } } @@ -459,8 +459,8 @@ } } }, - "200": { - "description": "Obtained debt position details.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -472,13 +472,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No debt position found.", + "200": { + "description": "Obtained debt position details.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -490,7 +490,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" } } } @@ -551,8 +551,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -569,8 +569,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -587,8 +587,8 @@ } } }, - "200": { - "description": "Debt Position updated.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -596,17 +596,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -614,10 +607,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Debt Position updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -629,13 +629,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModel" } } } }, - "404": { - "description": "No debt position found.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -709,8 +709,8 @@ } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -727,8 +727,8 @@ } } }, - "404": { - "description": "No debt position position found.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -745,8 +745,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -754,10 +754,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -765,13 +772,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -841,8 +841,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", @@ -850,17 +850,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -868,6 +861,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, "200": { @@ -888,8 +888,8 @@ } } }, - "404": { - "description": "No debt position found.", + "409": { + "description": "Conflict: debt position is not in publishable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1002,8 +1002,8 @@ } } }, - "200": { - "description": "Request published.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1015,13 +1015,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No debt position found.", + "200": { + "description": "Request published.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1033,7 +1033,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModel" } } } @@ -1085,6 +1085,17 @@ } } }, + "401": { + "description": "Wrong or missing function key.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } + }, "200": { "description": "OK.", "headers": { @@ -1113,17 +1124,6 @@ } } } - }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } } }, "security": [ diff --git a/openapi/openapi_external_massive.json b/openapi/openapi_external_massive.json index f2775ec4..3be46046 100644 --- a/openapi/openapi_external_massive.json +++ b/openapi/openapi_external_massive.json @@ -76,8 +76,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -94,8 +94,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -123,8 +123,8 @@ } } }, - "200": { - "description": "Debt Positions updated.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -132,10 +132,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Debt Positions updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -143,13 +150,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -191,8 +191,8 @@ "required": true }, "responses": { - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -200,13 +200,10 @@ "type": "string" } } - }, - "content": { - "application/json": {} } }, - "404": { - "description": "Payment Position not found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -237,8 +234,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "Payment Position not found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -246,10 +243,13 @@ "type": "string" } } + }, + "content": { + "application/json": {} } }, - "500": { - "description": "Service unavailable.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -352,8 +352,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -361,17 +361,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "201": { - "description": "Request created.", + "409": { + "description": "Conflict: duplicate debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -379,21 +372,17 @@ "type": "string" } } - } - }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", + }, + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "409": { - "description": "Conflict: duplicate debt position found.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -409,6 +398,17 @@ } } } + }, + "201": { + "description": "Request created.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } } }, "security": [ @@ -447,6 +447,17 @@ } } }, + "401": { + "description": "Wrong or missing function key.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } + }, "200": { "description": "OK.", "headers": { @@ -475,17 +486,6 @@ } } } - }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } } }, "security": [ diff --git a/openapi/openapi_external_v3.json b/openapi/openapi_external_v3.json index e732871d..1ba34f6b 100644 --- a/openapi/openapi_external_v3.json +++ b/openapi/openapi_external_v3.json @@ -1,1578 +1,1413 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Debt Position", - "description": "Progetto Gestione Posizioni Debitorie", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.12.1" + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Debt Position", + "description" : "Progetto Gestione Posizioni Debitorie", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "0.12.1" }, - "servers": [ - { - "url": "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v1/", - "description": "GPD Test environment" - }, - { - "url": "https://api.platform.pagopa.it/gpd/debt-positions-service/v1/", - "description": "GPD Production Environment" - }, - { - "url": "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v3/", - "description": "GPD Test environment" - }, - { - "url": "https://api.platform.pagopa.it/gpd/debt-positions-service/v3/", - "description": "GPD Production Environment" - }, - { - "url": "https://api.uat.platform.pagopa.it/aca/debt-positions-service/v1/", - "description": "ACA Test environment" - }, - { - "url": "https://api.platform.pagopa.it/aca/debt-positions-service/v1/", - "description": "ACA Production environment" - } - ], - "tags": [ - { - "name": "Debt Positions API: Installments and Payment Options Manager" - }, - { - "name": "Debt Position Actions API" - } - ], - "paths": { - "/v3/organizations/{organizationfiscalcode}/debtpositions/{iupd}": { - "get": { - "tags": [ - "Debt Positions API: Installments and Payment Options Manager" - ], - "summary": "Return the details of a specific debt position.", - "operationId": "getOrganizationDebtPositionByIUPD", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "pattern": "[\\w*\\h-]+", - "type": "string" - } - }, - { - "name": "iupd", - "in": "path", - "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" - } + "servers" : [ { + "url" : "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v1/", + "description" : "GPD Test environment" + }, { + "url" : "https://api.platform.pagopa.it/gpd/debt-positions-service/v1/", + "description" : "GPD Production Environment" + }, { + "url" : "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v3/", + "description" : "GPD Test environment" + }, { + "url" : "https://api.platform.pagopa.it/gpd/debt-positions-service/v3/", + "description" : "GPD Production Environment" + }, { + "url" : "https://api.uat.platform.pagopa.it/aca/debt-positions-service/v1/", + "description" : "ACA Test environment" + }, { + "url" : "https://api.platform.pagopa.it/aca/debt-positions-service/v1/", + "description" : "ACA Production environment" + } ], + "tags" : [ { + "name" : "Debt Positions API: Installments and Payment Options Manager" + }, { + "name" : "Debt Position Actions API" + } ], + "paths" : { + "/v3/organizations/{organizationfiscalcode}/debtpositions/{iupd}" : { + "get" : { + "tags" : [ "Debt Positions API: Installments and Payment Options Manager" ], + "summary" : "Return the details of a specific debt position.", + "operationId" : "getOrganizationDebtPositionByIUPD", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "pattern" : "[\\w*\\h-]+", + "type" : "string" + } + }, { + "name" : "iupd", + "in" : "path", + "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" } - ], - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + } ], + "responses" : { + "200" : { + "description" : "Obtained debt position details.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModelResponseV3" } } } }, - "200": { - "description": "Obtained debt position details.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelResponseV3" + "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" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "No debt position found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "No debt position found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "put": { - "tags": [ - "Debt Positions API: Installments and Payment Options Manager" - ], - "summary": "The Organization updates a debt position ", - "operationId": "updatePosition", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iupd", - "in": "path", - "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": { - "type": "string" - } - }, - { - "name": "toPublish", - "in": "query", - "required": false, - "schema": { - "type": "boolean", - "default": false - } + "put" : { + "tags" : [ "Debt Positions API: Installments and Payment Options Manager" ], + "summary" : "The Organization updates a debt position ", + "operationId" : "updatePosition", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iupd", + "in" : "path", + "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" : { + "type" : "string" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" + }, { + "name" : "toPublish", + "in" : "query", + "required" : false, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModelV3" } } }, - "required": true + "required" : true }, - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "responses" : { + "409" : { + "description" : "Conflict: existing related payment found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Malformed request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Debt Position updated.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "No debt position found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "409": { - "description": "Conflict: existing related payment found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Debt Position updated.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModelV3" } } } }, - "404": { - "description": "No debt position found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "400" : { + "description" : "Malformed request.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "delete": { - "tags": [ - "Debt Positions API: Installments and Payment Options Manager" - ], - "summary": "The Organization deletes a debt position", - "operationId": "deletePosition", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "pattern": "[\\w*\\h-]+", - "type": "string" - } - }, - { - "name": "iupd", - "in": "path", - "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" - } + "delete" : { + "tags" : [ "Debt Positions API: Installments and Payment Options Manager" ], + "summary" : "The Organization deletes a debt position", + "operationId" : "deletePosition", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "pattern" : "[\\w*\\h-]+", + "type" : "string" + } + }, { + "name" : "iupd", + "in" : "path", + "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" } - ], - "responses": { - "200": { - "description": "Operation completed successfully.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + } ], + "responses" : { + "200" : { + "description" : "Operation completed successfully.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "type": "string" + "content" : { + "application/json" : { + "schema" : { + "type" : "string" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "No debt position position found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No debt position position found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "409" : { + "description" : "Conflict: existing related payment found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } - } - }, - "409": { - "description": "Conflict: existing related payment found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } - }, - "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" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "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" - } + "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" } - ] + } ] }, - "/v3/organizations/{organizationfiscalcode}/debtpositions": { - "get": { - "tags": [ - "Debt Positions API: Installments and Payment Options Manager" - ], - "summary": "Return the list of the organization debt positions. The due dates interval is mutually exclusive with the payment dates interval.", - "operationId": "getOrganizationDebtPositions", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "description": "Number of elements on one page. Default = 50", - "required": false, - "schema": { - "maximum": 50, - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "page", - "in": "query", - "description": "Page number. Page value starts from 0", - "required": false, - "schema": { - "minimum": 0, - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "due_date_from", - "in": "query", - "description": "Filter from due_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days before the due_date_to.", - "required": false, - "schema": { - "type": "string", - "format": "date" - } - }, - { - "name": "due_date_to", - "in": "query", - "description": "Filter to due_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days after the due_date_from.", - "required": false, - "schema": { - "type": "string", - "format": "date" - } - }, - { - "name": "payment_date_from", - "in": "query", - "description": "Filter from payment_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days before the payment_date_to.", - "required": false, - "schema": { - "type": "string", - "format": "date" - } - }, - { - "name": "payment_date_to", - "in": "query", - "description": "Filter to payment_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days after the payment_date_from", - "required": false, - "schema": { - "type": "string", - "format": "date" - } - }, - { - "name": "status", - "in": "query", - "description": "Filter by debt position status", - "required": false, - "schema": { - "type": "string", - "enum": [ - "DRAFT", - "PUBLISHED", - "VALID", - "UNPAYABLE", - "PARTIALLY_PAID", - "PAID" - ] - } - }, - { - "name": "orderby", - "in": "query", - "description": "Order by INSERTED_DATE, COMPANY_NAME, IUPD or STATUS", - "required": false, - "schema": { - "type": "string", - "default": "INSERTED_DATE", - "enum": [ - "INSERTED_DATE", - "IUPD", - "STATUS", - "COMPANY_NAME" - ] - } - }, - { - "name": "ordering", - "in": "query", - "description": "Direction of ordering", - "required": false, - "schema": { - "type": "string", - "default": "DESC", - "enum": [ - "ASC", - "DESC" - ] - } + "/v3/organizations/{organizationfiscalcode}/debtpositions" : { + "get" : { + "tags" : [ "Debt Positions API: Installments and Payment Options Manager" ], + "summary" : "Return the list of the organization debt positions. The due dates interval is mutually exclusive with the payment dates interval.", + "operationId" : "getOrganizationDebtPositions", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "description" : "Number of elements on one page. Default = 50", + "required" : false, + "schema" : { + "maximum" : 50, + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "page", + "in" : "query", + "description" : "Page number. Page value starts from 0", + "required" : false, + "schema" : { + "minimum" : 0, + "type" : "integer", + "format" : "int32", + "default" : 0 + } + }, { + "name" : "due_date_from", + "in" : "query", + "description" : "Filter from due_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days before the due_date_to.", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date" + } + }, { + "name" : "due_date_to", + "in" : "query", + "description" : "Filter to due_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days after the due_date_from.", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date" + } + }, { + "name" : "payment_date_from", + "in" : "query", + "description" : "Filter from payment_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days before the payment_date_to.", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date" + } + }, { + "name" : "payment_date_to", + "in" : "query", + "description" : "Filter to payment_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days after the payment_date_from", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date" } - ], - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, { + "name" : "status", + "in" : "query", + "description" : "Filter by debt position status", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "DRAFT", "PUBLISHED", "VALID", "UNPAYABLE", "PARTIALLY_PAID", "PAID" ] + } + }, { + "name" : "orderby", + "in" : "query", + "description" : "Order by INSERTED_DATE, COMPANY_NAME, IUPD or STATUS", + "required" : false, + "schema" : { + "type" : "string", + "default" : "INSERTED_DATE", + "enum" : [ "INSERTED_DATE", "IUPD", "STATUS", "COMPANY_NAME" ] + } + }, { + "name" : "ordering", + "in" : "query", + "description" : "Direction of ordering", + "required" : false, + "schema" : { + "type" : "string", + "default" : "DESC", + "enum" : [ "ASC", "DESC" ] + } + } ], + "responses" : { + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "400": { - "description": "Malformed request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Obtained all organization payment positions.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionsInfoV3" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "400" : { + "description" : "Malformed request.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } - } - }, - "200": { - "description": "Obtained all organization payment positions.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionsInfoV3" + } + }, + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "post": { - "tags": [ - "Debt Positions API: Installments and Payment Options Manager" - ], - "summary": "The Organization creates a debt Position.", - "operationId": "createPosition", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "toPublish", - "in": "query", - "required": false, - "schema": { - "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" - ] - } + "post" : { + "tags" : [ "Debt Positions API: Installments and Payment Options Manager" ], + "summary" : "The Organization creates a debt Position.", + "operationId" : "createPosition", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "toPublish", + "in" : "query", + "required" : false, + "schema" : { + "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": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModelV3" } } }, - "required": true + "required" : true }, - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "responses" : { + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Malformed request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "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" } } } }, - "201": { - "description": "Request created.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "409" : { + "description" : "Conflict: duplicate debt position found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" + "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" + "400" : { + "description" : "Malformed request.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "409": { - "description": "Conflict: duplicate debt position found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "201" : { + "description" : "Request created.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModelV3" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "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" - } + "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" } - ] + } ] }, - "/v3/organizations/{organizationfiscalcode}/debtpositions/{iupd}/publish": { - "post": { - "tags": [ - "Debt Position Actions API" - ], - "summary": "The Organization publish a debt Position.", - "operationId": "publishPosition", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iupd", - "in": "path", - "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": { - "type": "string" - } + "/v3/organizations/{organizationfiscalcode}/debtpositions/{iupd}/publish" : { + "post" : { + "tags" : [ "Debt Position Actions API" ], + "summary" : "The Organization publish a debt Position.", + "operationId" : "publishPosition", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" } - ], - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, { + "name" : "iupd", + "in" : "path", + "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" : { + "type" : "string" + } + } ], + "responses" : { + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "409": { - "description": "Conflict: debt position is not in publishable state.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "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" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "No debt position found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Request published.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Request published.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModelV3" } } } }, - "404": { - "description": "No debt position found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "409" : { + "description" : "Conflict: debt position is not in publishable state.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "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" - } + "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" } - ] + } ] } }, - "components": { - "schemas": { - "DebtorModel": { - "required": [ - "fiscalCode", - "fullName", - "type" - ], - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "F", - "G" - ] - }, - "fiscalCode": { - "type": "string" - }, - "fullName": { - "type": "string" - }, - "streetName": { - "type": "string" - }, - "civicNumber": { - "type": "string" - }, - "postalCode": { - "type": "string" - }, - "city": { - "type": "string" - }, - "province": { - "type": "string" - }, - "region": { - "type": "string" - }, - "country": { - "pattern": "[A-Z]{2}", - "type": "string", - "example": "IT" - }, - "email": { - "type": "string", - "example": "email@domain.com" - }, - "phone": { - "type": "string" + "components" : { + "schemas" : { + "DebtorModel" : { + "required" : [ "fiscalCode", "fullName", "type" ], + "type" : "object", + "properties" : { + "type" : { + "type" : "string", + "enum" : [ "F", "G" ] + }, + "fiscalCode" : { + "type" : "string" + }, + "fullName" : { + "type" : "string" + }, + "streetName" : { + "type" : "string" + }, + "civicNumber" : { + "type" : "string" + }, + "postalCode" : { + "type" : "string" + }, + "city" : { + "type" : "string" + }, + "province" : { + "type" : "string" + }, + "region" : { + "type" : "string" + }, + "country" : { + "pattern" : "[A-Z]{2}", + "type" : "string", + "example" : "IT" + }, + "email" : { + "type" : "string", + "example" : "email@domain.com" + }, + "phone" : { + "type" : "string" } } }, - "InstallmentMetadataModel": { - "required": [ - "key" - ], - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "InstallmentMetadataModel" : { + "required" : [ "key" ], + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" } } }, - "InstallmentModel": { - "required": [ - "amount", - "description", - "dueDate", - "iuv" - ], - "type": "object", - "properties": { - "nav": { - "type": "string" - }, - "iuv": { - "type": "string" - }, - "amount": { - "type": "integer", - "format": "int64" - }, - "description": { - "maxLength": 140, - "minLength": 0, - "type": "string" - }, - "dueDate": { - "type": "string", - "format": "date-time" - }, - "fee": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "notificationFee": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "status": { - "type": "string", - "readOnly": true, - "enum": [ - "UNPAID", - "PAID", - "PARTIALLY_REPORTED", - "REPORTED", - "UNPAYABLE", - "EXPIRED" - ] - }, - "transfer": { - "maxItems": 2147483647, - "minItems": 1, - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferModel" - } - }, - "installmentMetadata": { - "maxItems": 10, - "minItems": 0, - "type": "array", - "description": "it can added a maximum of 10 key-value pairs for metadata", - "items": { - "$ref": "#/components/schemas/InstallmentMetadataModel" + "InstallmentModel" : { + "required" : [ "amount", "description", "dueDate", "iuv" ], + "type" : "object", + "properties" : { + "nav" : { + "type" : "string" + }, + "iuv" : { + "type" : "string" + }, + "amount" : { + "type" : "integer", + "format" : "int64" + }, + "description" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string" + }, + "dueDate" : { + "type" : "string", + "format" : "date-time" + }, + "fee" : { + "type" : "integer", + "format" : "int64", + "readOnly" : true + }, + "notificationFee" : { + "type" : "integer", + "format" : "int64", + "readOnly" : true + }, + "status" : { + "type" : "string", + "readOnly" : true, + "enum" : [ "UNPAID", "PAID", "PARTIALLY_REPORTED", "REPORTED", "UNPAYABLE", "EXPIRED" ] + }, + "transfer" : { + "maxItems" : 2147483647, + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferModel" + } + }, + "installmentMetadata" : { + "maxItems" : 10, + "minItems" : 0, + "type" : "array", + "description" : "it can added a maximum of 10 key-value pairs for metadata", + "items" : { + "$ref" : "#/components/schemas/InstallmentMetadataModel" } } } }, - "PaymentOptionModelV3": { - "required": [ - "debtor", - "installments", - "switchToExpired" - ], - "type": "object", - "properties": { - "description": { - "maxLength": 140, - "minLength": 0, - "type": "string", - "writeOnly": true - }, - "validityDate": { - "type": "string", - "format": "date-time" - }, - "retentionDate": { - "type": "string", - "format": "date-time" - }, - "switchToExpired": { - "type": "boolean", - "description": "feature flag to enable the payment option to expire after the due date", - "example": false, - "default": false - }, - "debtor": { - "$ref": "#/components/schemas/DebtorModel" - }, - "installments": { - "maxItems": 100, - "minItems": 1, - "type": "array", - "items": { - "$ref": "#/components/schemas/InstallmentModel" + "PaymentOptionModelV3" : { + "required" : [ "debtor", "installments", "switchToExpired" ], + "type" : "object", + "properties" : { + "description" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string", + "writeOnly" : true + }, + "validityDate" : { + "type" : "string", + "format" : "date-time" + }, + "retentionDate" : { + "type" : "string", + "format" : "date-time" + }, + "switchToExpired" : { + "type" : "boolean", + "description" : "feature flag to enable the payment option to expire after the due date", + "example" : false, + "default" : false + }, + "debtor" : { + "$ref" : "#/components/schemas/DebtorModel" + }, + "installments" : { + "maxItems" : 100, + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/InstallmentModel" } } } }, - "PaymentPositionModelV3": { - "required": [ - "companyName", - "iupd", - "paymentOption" - ], - "type": "object", - "properties": { - "iupd": { - "type": "string" - }, - "payStandIn": { - "type": "boolean", - "description": "feature flag to enable a debt position in stand-in mode", - "example": true, - "default": true - }, - "companyName": { - "maxLength": 140, - "minLength": 0, - "type": "string" - }, - "officeName": { - "maxLength": 140, - "minLength": 0, - "type": "string" - }, - "paymentDate": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "status": { - "type": "string", - "readOnly": true, - "enum": [ - "DRAFT", - "PUBLISHED", - "VALID", - "UNPAYABLE", - "PARTIALLY_PAID", - "PAID" - ] - }, - "paymentOption": { - "maxItems": 100, - "minItems": 1, - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentOptionModelV3" + "PaymentPositionModelV3" : { + "required" : [ "companyName", "iupd", "paymentOption" ], + "type" : "object", + "properties" : { + "iupd" : { + "type" : "string" + }, + "payStandIn" : { + "type" : "boolean", + "description" : "feature flag to enable a debt position in stand-in mode", + "example" : true, + "default" : true + }, + "companyName" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string" + }, + "officeName" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string" + }, + "paymentDate" : { + "type" : "string", + "format" : "date-time", + "readOnly" : true + }, + "status" : { + "type" : "string", + "readOnly" : true, + "enum" : [ "DRAFT", "PUBLISHED", "VALID", "UNPAYABLE", "PARTIALLY_PAID", "PAID" ] + }, + "paymentOption" : { + "maxItems" : 100, + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentOptionModelV3" } } } }, - "Stamp": { - "required": [ - "hashDocument", - "provincialResidence", - "stampType" - ], - "type": "object", - "properties": { - "hashDocument": { - "maxLength": 72, - "minLength": 0, - "type": "string", - "description": "Document hash type is stBase64Binary72 as described in https://github.com/pagopa/pagopa-api." - }, - "stampType": { - "maxLength": 2, - "minLength": 2, - "type": "string", - "description": "The type of the stamp" - }, - "provincialResidence": { - "pattern": "[A-Z]{2}", - "type": "string", - "description": "The provincial of the residence", - "example": "RM" + "Stamp" : { + "required" : [ "hashDocument", "provincialResidence", "stampType" ], + "type" : "object", + "properties" : { + "hashDocument" : { + "maxLength" : 72, + "minLength" : 0, + "type" : "string", + "description" : "Document hash type is stBase64Binary72 as described in https://github.com/pagopa/pagopa-api." + }, + "stampType" : { + "maxLength" : 2, + "minLength" : 2, + "type" : "string", + "description" : "The type of the stamp" + }, + "provincialResidence" : { + "pattern" : "[A-Z]{2}", + "type" : "string", + "description" : "The provincial of the residence", + "example" : "RM" } } }, - "TransferMetadataModel": { - "required": [ - "key" - ], - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "TransferMetadataModel" : { + "required" : [ "key" ], + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" } }, - "description": "it can added a maximum of 10 key-value pairs for metadata" + "description" : "it can added a maximum of 10 key-value pairs for metadata" }, - "TransferModel": { - "required": [ - "amount", - "category", - "idTransfer", - "remittanceInformation" - ], - "type": "object", - "properties": { - "idTransfer": { - "type": "string", - "enum": [ - "1", - "2", - "3", - "4", - "5" - ] - }, - "amount": { - "type": "integer", - "format": "int64" - }, - "organizationFiscalCode": { - "type": "string", - "description": "Fiscal code related to the organization targeted by this transfer.", - "example": "00000000000" - }, - "remittanceInformation": { - "maxLength": 140, - "minLength": 0, - "type": "string" - }, - "category": { - "type": "string" - }, - "iban": { - "type": "string", - "description": "mutual exclusive with stamp", - "example": "IT0000000000000000000000000" - }, - "postalIban": { - "type": "string", - "description": "optional - can be combined with iban but not with stamp", - "example": "IT0000000000000000000000000" - }, - "stamp": { - "$ref": "#/components/schemas/Stamp" - }, - "companyName": { - "maxLength": 140, - "minLength": 0, - "type": "string" - }, - "transferMetadata": { - "maxItems": 10, - "minItems": 0, - "type": "array", - "description": "it can added a maximum of 10 key-value pairs for metadata", - "items": { - "$ref": "#/components/schemas/TransferMetadataModel" + "TransferModel" : { + "required" : [ "amount", "category", "idTransfer", "remittanceInformation" ], + "type" : "object", + "properties" : { + "idTransfer" : { + "type" : "string", + "enum" : [ "1", "2", "3", "4", "5" ] + }, + "amount" : { + "type" : "integer", + "format" : "int64" + }, + "organizationFiscalCode" : { + "type" : "string", + "description" : "Fiscal code related to the organization targeted by this transfer.", + "example" : "00000000000" + }, + "remittanceInformation" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string" + }, + "category" : { + "type" : "string" + }, + "iban" : { + "type" : "string", + "description" : "mutual exclusive with stamp", + "example" : "IT0000000000000000000000000" + }, + "postalIban" : { + "type" : "string", + "description" : "optional - can be combined with iban but not with stamp", + "example" : "IT0000000000000000000000000" + }, + "stamp" : { + "$ref" : "#/components/schemas/Stamp" + }, + "companyName" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string" + }, + "transferMetadata" : { + "maxItems" : 10, + "minItems" : 0, + "type" : "array", + "description" : "it can added a maximum of 10 key-value pairs for metadata", + "items" : { + "$ref" : "#/components/schemas/TransferMetadataModel" } } } }, - "ProblemJson": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" - }, - "status": { - "maximum": 600, - "minimum": 100, - "type": "integer", - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "format": "int32", - "example": 200 - }, - "detail": { - "type": "string", - "description": "A human readable explanation specific to this occurrence of the problem.", - "example": "There was an error processing the request" + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 + }, + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" } } }, - "InstallmentModelResponse": { - "type": "object", - "properties": { - "nav": { - "type": "string" - }, - "iuv": { - "type": "string" - }, - "organizationFiscalCode": { - "type": "string" - }, - "amount": { - "type": "integer", - "format": "int64" - }, - "description": { - "type": "string" - }, - "dueDate": { - "type": "string", - "format": "date-time" - }, - "paymentDate": { - "type": "string", - "format": "date-time" - }, - "reportingDate": { - "type": "string", - "format": "date-time" - }, - "paymentMethod": { - "type": "string" - }, - "pspCompany": { - "type": "string" - }, - "fee": { - "type": "integer", - "format": "int64" - }, - "notificationFee": { - "type": "integer", - "format": "int64" - }, - "idReceipt": { - "type": "string" - }, - "idFlowReporting": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "UNPAID", - "PAID", - "PARTIALLY_REPORTED", - "REPORTED", - "UNPAYABLE", - "EXPIRED" - ] - }, - "lastUpdatedDate": { - "type": "string", - "format": "date-time" - }, - "installmentMetadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InstallmentMetadataModel" + "InstallmentModelResponse" : { + "type" : "object", + "properties" : { + "nav" : { + "type" : "string" + }, + "iuv" : { + "type" : "string" + }, + "organizationFiscalCode" : { + "type" : "string" + }, + "amount" : { + "type" : "integer", + "format" : "int64" + }, + "description" : { + "type" : "string" + }, + "dueDate" : { + "type" : "string", + "format" : "date-time" + }, + "paymentDate" : { + "type" : "string", + "format" : "date-time" + }, + "reportingDate" : { + "type" : "string", + "format" : "date-time" + }, + "paymentMethod" : { + "type" : "string" + }, + "pspCompany" : { + "type" : "string" + }, + "fee" : { + "type" : "integer", + "format" : "int64" + }, + "notificationFee" : { + "type" : "integer", + "format" : "int64" + }, + "idReceipt" : { + "type" : "string" + }, + "idFlowReporting" : { + "type" : "string" + }, + "status" : { + "type" : "string", + "enum" : [ "UNPAID", "PAID", "PARTIALLY_REPORTED", "REPORTED", "UNPAYABLE", "EXPIRED" ] + }, + "lastUpdatedDate" : { + "type" : "string", + "format" : "date-time" + }, + "installmentMetadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/InstallmentMetadataModel" } }, - "transfer": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferModelResponse" + "transfer" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferModelResponse" } } } }, - "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" + "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" } } }, - "PaymentOptionModelResponseV3": { - "type": "object", - "properties": { - "switchToExpired": { - "type": "boolean" - }, - "retentionDate": { - "type": "string", - "format": "date-time" - }, - "insertedDate": { - "type": "string", - "format": "date-time" - }, - "validityDate": { - "type": "string", - "format": "date-time" - }, - "debtor": { - "$ref": "#/components/schemas/DebtorModel" - }, - "installments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InstallmentModelResponse" + "PaymentOptionModelResponseV3" : { + "type" : "object", + "properties" : { + "switchToExpired" : { + "type" : "boolean" + }, + "retentionDate" : { + "type" : "string", + "format" : "date-time" + }, + "insertedDate" : { + "type" : "string", + "format" : "date-time" + }, + "validityDate" : { + "type" : "string", + "format" : "date-time" + }, + "debtor" : { + "$ref" : "#/components/schemas/DebtorModel" + }, + "installments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/InstallmentModelResponse" } } } }, - "PaymentPositionModelResponseV3": { - "type": "object", - "properties": { - "iupd": { - "type": "string" - }, - "organizationFiscalCode": { - "type": "string" - }, - "companyName": { - "type": "string" - }, - "officeName": { - "type": "string" - }, - "insertedDate": { - "type": "string", - "format": "date-time" - }, - "publishDate": { - "type": "string", - "format": "date-time" - }, - "paymentDate": { - "type": "string", - "format": "date-time" - }, - "status": { - "type": "string", - "enum": [ - "DRAFT", - "PUBLISHED", - "VALID", - "UNPAYABLE", - "PARTIALLY_PAID", - "PAID" - ] - }, - "lastUpdatedDate": { - "type": "string", - "format": "date-time" - }, - "paymentOption": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentOptionModelResponseV3" + "PaymentPositionModelResponseV3" : { + "type" : "object", + "properties" : { + "iupd" : { + "type" : "string" + }, + "organizationFiscalCode" : { + "type" : "string" + }, + "companyName" : { + "type" : "string" + }, + "officeName" : { + "type" : "string" + }, + "insertedDate" : { + "type" : "string", + "format" : "date-time" + }, + "publishDate" : { + "type" : "string", + "format" : "date-time" + }, + "paymentDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "enum" : [ "DRAFT", "PUBLISHED", "VALID", "UNPAYABLE", "PARTIALLY_PAID", "PAID" ] + }, + "lastUpdatedDate" : { + "type" : "string", + "format" : "date-time" + }, + "paymentOption" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentOptionModelResponseV3" } } } }, - "PaymentPositionsInfoV3": { - "required": [ - "page_info", - "payment_position_list" - ], - "type": "object", - "properties": { - "payment_position_list": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentPositionModelResponseV3" - } - }, - "page_info": { - "$ref": "#/components/schemas/PageInfo" + "PaymentPositionsInfoV3" : { + "required" : [ "page_info", "payment_position_list" ], + "type" : "object", + "properties" : { + "payment_position_list" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentPositionModelResponseV3" + } + }, + "page_info" : { + "$ref" : "#/components/schemas/PageInfo" } } }, - "TransferMetadataModelResponse": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "TransferMetadataModelResponse" : { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" } } }, - "TransferModelResponse": { - "type": "object", - "properties": { - "organizationFiscalCode": { - "type": "string" + "TransferModelResponse" : { + "type" : "object", + "properties" : { + "organizationFiscalCode" : { + "type" : "string" }, - "companyName": { - "type": "string" + "companyName" : { + "type" : "string" }, - "idTransfer": { - "type": "string" + "idTransfer" : { + "type" : "string" }, - "amount": { - "type": "integer", - "format": "int64" + "amount" : { + "type" : "integer", + "format" : "int64" }, - "remittanceInformation": { - "type": "string" + "remittanceInformation" : { + "type" : "string" }, - "category": { - "type": "string" + "category" : { + "type" : "string" }, - "iban": { - "type": "string" + "iban" : { + "type" : "string" }, - "postalIban": { - "type": "string" + "postalIban" : { + "type" : "string" }, - "stamp": { - "$ref": "#/components/schemas/Stamp" + "stamp" : { + "$ref" : "#/components/schemas/Stamp" }, - "insertedDate": { - "type": "string", - "format": "date-time" + "insertedDate" : { + "type" : "string", + "format" : "date-time" }, - "status": { - "type": "string", - "enum": [ - "T_UNREPORTED", - "T_REPORTED" - ] + "status" : { + "type" : "string", + "enum" : [ "T_UNREPORTED", "T_REPORTED" ] }, - "lastUpdatedDate": { - "type": "string", - "format": "date-time" + "lastUpdatedDate" : { + "type" : "string", + "format" : "date-time" }, - "transferMetadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferMetadataModelResponse" + "transferMetadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferMetadataModelResponse" } } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" }, - "Authorization": { - "type": "http", - "description": "JWT token get after Azure Login", - "scheme": "bearer", - "bearerFormat": "JWT" + "Authorization" : { + "type" : "http", + "description" : "JWT token get after Azure Login", + "scheme" : "bearer", + "bearerFormat" : "JWT" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi_internal.json b/openapi/openapi_internal.json index 062502af..1dd80e66 100644 --- a/openapi/openapi_internal.json +++ b/openapi/openapi_internal.json @@ -73,6 +73,17 @@ } } }, + "401": { + "description": "Wrong or missing function key.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } + }, "200": { "description": "OK.", "headers": { @@ -101,17 +112,6 @@ } } } - }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } } }, "security": [ @@ -284,8 +284,8 @@ } } }, - "429": { - "description": "Too many requests.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -313,8 +313,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "429": { + "description": "Too many requests.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -422,8 +422,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -431,17 +431,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "201": { - "description": "Request created.", + "409": { + "description": "Conflict: duplicate debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -453,13 +446,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -467,10 +460,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: duplicate debt position found.", + "201": { + "description": "Request created.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -482,7 +482,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModel" } } } @@ -567,8 +567,8 @@ } } }, - "200": { - "description": "Obtained debt position details.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -580,13 +580,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No debt position found.", + "200": { + "description": "Obtained debt position details.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -598,7 +598,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" } } } @@ -659,8 +659,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -677,8 +677,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -695,8 +695,8 @@ } } }, - "200": { - "description": "Debt Position updated.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -704,17 +704,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -722,10 +715,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Debt Position updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -737,13 +737,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModel" } } } }, - "404": { - "description": "No debt position found.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -817,8 +817,8 @@ } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -835,8 +835,8 @@ } } }, - "404": { - "description": "No debt position position found.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -853,8 +853,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -862,10 +862,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -873,13 +880,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -978,8 +978,8 @@ } } }, - "200": { - "description": "Request published.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -991,13 +991,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No debt position found.", + "200": { + "description": "Request published.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1009,7 +1009,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModel" } } } @@ -1081,8 +1081,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", @@ -1090,17 +1090,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1108,6 +1101,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, "200": { @@ -1128,8 +1128,8 @@ } } }, - "404": { - "description": "No debt position found.", + "409": { + "description": "Conflict: debt position is not in publishable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1197,8 +1197,8 @@ } ], "responses": { - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1206,13 +1206,10 @@ "type": "string" } } - }, - "content": { - "application/json": {} } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1220,6 +1217,9 @@ "type": "string" } } + }, + "content": { + "application/json": {} } }, "404": { @@ -1236,8 +1236,8 @@ "application/json": {} } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1245,10 +1245,13 @@ "type": "string" } } + }, + "content": { + "application/json": {} } }, - "500": { - "description": "Service unavailable.", + "429": { + "description": "Too many requests.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1256,9 +1259,6 @@ "type": "string" } } - }, - "content": { - "application/json": {} } }, "200": { @@ -1337,8 +1337,8 @@ } ], "responses": { - "500": { - "description": "Service unavailable.", + "200": { + "description": "Request reported.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1350,13 +1350,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/TransferModelResponse" } } } }, - "200": { - "description": "Request reported.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1368,13 +1368,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TransferModelResponse" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No transfer found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1391,8 +1391,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1400,17 +1400,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1418,10 +1411,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "404": { + "description": "No transfer found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1507,8 +1507,8 @@ } } }, - "200": { - "description": "Obtained payment option details.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1516,17 +1516,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentsWithDebtorInfoModelResponse" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1534,10 +1527,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "404": { - "description": "No payment option found.", + "200": { + "description": "Obtained payment option details.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1549,7 +1549,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentsWithDebtorInfoModelResponse" } } } @@ -1631,8 +1631,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1640,13 +1640,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, "422": { @@ -1667,8 +1660,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1676,10 +1669,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "200": { - "description": "Request updated.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1691,13 +1691,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", @@ -1714,8 +1714,8 @@ } } }, - "404": { - "description": "No payment option found.", + "209": { + "description": "Request updated with a payment in progress.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1727,7 +1727,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentsModelResponse" } } } @@ -1791,8 +1791,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1809,8 +1809,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1838,8 +1838,8 @@ } } }, - "422": { - "description": "Unprocessable: not in payable state.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1856,8 +1856,8 @@ } } }, - "200": { - "description": "Request paid.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1869,13 +1869,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentsModelResponse" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No payment option found.", + "422": { + "description": "Unprocessable: not in payable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1892,8 +1892,8 @@ } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Request paid.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1905,7 +1905,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentsModelResponse" } } } @@ -1931,10 +1931,10 @@ } ] }, - "/organizations/{organizationfiscalcode}/transfers/update/iban": { - "post": { + "/organizations/{organizationfiscalcode}/transfers": { + "patch": { "tags": [ - "Payments API" + "Debt Positions API" ], "summary": "The Organization updates the IBANs of every updatable payment option's transfers", "operationId": "updateTransferIbanMassive", @@ -1947,6 +1947,15 @@ "schema": { "type": "string" } + }, + { + "name": "oldIban", + "in": "query", + "description": "The old iban to replace", + "required": true, + "schema": { + "type": "string" + } } ], "requestBody": { @@ -1978,8 +1987,8 @@ } } }, - "404": { - "description": "No debt position in updatable state found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1987,13 +1996,6 @@ "type": "string" } } - }, - "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, "400": { @@ -2014,8 +2016,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "200": { + "description": "IBANs updated", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2023,10 +2025,17 @@ "type": "string" } } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } } }, - "200": { - "description": "IBANs updated", + "404": { + "description": "No debt position in updatable state found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2038,7 +2047,7 @@ "content": { "text/plain": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ProblemJson" } } } @@ -2212,8 +2221,8 @@ } } }, - "429": { - "description": "Too many requests.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2223,8 +2232,8 @@ } } }, - "400": { - "description": "Malformed request.", + "200": { + "description": "Obtained all organization payment positions.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2236,13 +2245,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionsInfoV3" } } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2250,10 +2259,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "200": { - "description": "Obtained all organization payment positions.", + "429": { + "description": "Too many requests.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2261,13 +2277,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionsInfoV3" - } - } } } }, @@ -2347,8 +2356,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2356,17 +2365,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "201": { - "description": "Request created.", + "409": { + "description": "Conflict: duplicate debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2378,13 +2380,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2392,10 +2394,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: duplicate debt position found.", + "201": { + "description": "Request created.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2407,7 +2416,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelV3" } } } @@ -2460,8 +2469,8 @@ } ], "responses": { - "500": { - "description": "Service unavailable.", + "200": { + "description": "Obtained debt position details.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2473,13 +2482,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelResponseV3" } } } }, - "200": { - "description": "Obtained debt position details.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2491,7 +2500,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModelResponseV3" + "$ref": "#/components/schemas/ProblemJson" } } } @@ -2578,8 +2587,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2596,8 +2605,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2614,8 +2623,8 @@ } } }, - "200": { - "description": "Debt Position updated.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2623,17 +2632,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2641,10 +2643,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Debt Position updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2656,13 +2665,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelV3" } } } }, - "404": { - "description": "No debt position found.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2733,8 +2742,8 @@ } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2751,8 +2760,8 @@ } } }, - "404": { - "description": "No debt position position found.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2769,8 +2778,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2778,10 +2787,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2789,13 +2805,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -2862,8 +2871,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", @@ -2871,17 +2880,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2889,6 +2891,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, "200": { @@ -2909,8 +2918,8 @@ } } }, - "404": { - "description": "No debt position found.", + "409": { + "description": "Conflict: debt position is not in publishable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -3691,21 +3700,6 @@ } } }, - "UpdateTransferIbanMassiveModel": { - "required": [ - "newIban", - "oldIban" - ], - "type": "object", - "properties": { - "oldIban": { - "type": "string" - }, - "newIban": { - "type": "string" - } - } - }, "PayPaymentOptionModel": { "required": [ "idReceipt", @@ -3731,6 +3725,17 @@ } } }, + "UpdateTransferIbanMassiveModel": { + "required": [ + "newIban" + ], + "type": "object", + "properties": { + "newIban": { + "type": "string" + } + } + }, "InstallmentModelResponse": { "type": "object", "properties": { diff --git a/openapi/openapi_internal_massive.json b/openapi/openapi_internal_massive.json index 0b6272ba..3912e64a 100644 --- a/openapi/openapi_internal_massive.json +++ b/openapi/openapi_internal_massive.json @@ -73,6 +73,17 @@ } } }, + "401": { + "description": "Wrong or missing function key.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } + }, "200": { "description": "OK.", "headers": { @@ -101,17 +112,6 @@ } } } - }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } } }, "security": [ @@ -284,8 +284,8 @@ } } }, - "429": { - "description": "Too many requests.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -313,8 +313,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "429": { + "description": "Too many requests.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -389,8 +389,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -407,8 +407,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -436,8 +436,8 @@ } } }, - "200": { - "description": "Debt Positions updated.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -445,10 +445,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Debt Positions updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -456,13 +463,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -504,8 +504,8 @@ "required": true }, "responses": { - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -513,13 +513,10 @@ "type": "string" } } - }, - "content": { - "application/json": {} } }, - "404": { - "description": "Payment Position not found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -550,8 +547,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "Payment Position not found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -559,10 +556,13 @@ "type": "string" } } + }, + "content": { + "application/json": {} } }, - "500": { - "description": "Service unavailable.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -665,8 +665,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -674,17 +674,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "201": { - "description": "Request created.", + "409": { + "description": "Conflict: duplicate debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -692,21 +685,17 @@ "type": "string" } } - } - }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", + }, + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "409": { - "description": "Conflict: duplicate debt position found.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -722,6 +711,17 @@ } } } + }, + "201": { + "description": "Request created.", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" + } + } + } } }, "security": [ @@ -793,8 +793,8 @@ } } }, - "200": { - "description": "Obtained debt position details.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -806,13 +806,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No debt position found.", + "200": { + "description": "Obtained debt position details.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -824,7 +824,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" } } } @@ -885,8 +885,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -903,8 +903,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -921,8 +921,8 @@ } } }, - "200": { - "description": "Debt Position updated.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -930,17 +930,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -948,10 +941,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Debt Position updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -963,13 +963,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModel" } } } }, - "404": { - "description": "No debt position found.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1043,8 +1043,8 @@ } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1061,8 +1061,8 @@ } } }, - "404": { - "description": "No debt position position found.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1079,8 +1079,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1088,10 +1088,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1099,13 +1106,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -1204,8 +1204,8 @@ } } }, - "200": { - "description": "Request published.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1217,13 +1217,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No debt position found.", + "200": { + "description": "Request published.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1235,7 +1235,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModel" } } } @@ -1307,8 +1307,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", @@ -1316,17 +1316,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1334,6 +1327,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, "200": { @@ -1354,8 +1354,8 @@ } } }, - "404": { - "description": "No debt position found.", + "409": { + "description": "Conflict: debt position is not in publishable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1423,8 +1423,8 @@ } ], "responses": { - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1432,13 +1432,10 @@ "type": "string" } } - }, - "content": { - "application/json": {} } }, - "429": { - "description": "Too many requests.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1446,6 +1443,9 @@ "type": "string" } } + }, + "content": { + "application/json": {} } }, "404": { @@ -1462,8 +1462,8 @@ "application/json": {} } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1471,10 +1471,13 @@ "type": "string" } } + }, + "content": { + "application/json": {} } }, - "500": { - "description": "Service unavailable.", + "429": { + "description": "Too many requests.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1482,9 +1485,6 @@ "type": "string" } } - }, - "content": { - "application/json": {} } }, "200": { @@ -1563,8 +1563,8 @@ } ], "responses": { - "500": { - "description": "Service unavailable.", + "200": { + "description": "Request reported.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1576,13 +1576,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/TransferModelResponse" } } } }, - "200": { - "description": "Request reported.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1594,13 +1594,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TransferModelResponse" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No transfer found.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1617,8 +1617,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1626,17 +1626,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1644,10 +1637,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "404": { + "description": "No transfer found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1733,8 +1733,8 @@ } } }, - "200": { - "description": "Obtained payment option details.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1742,17 +1742,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentsWithDebtorInfoModelResponse" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1760,10 +1753,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "404": { - "description": "No payment option found.", + "200": { + "description": "Obtained payment option details.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1775,7 +1775,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentsWithDebtorInfoModelResponse" } } } @@ -1857,8 +1857,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1866,13 +1866,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, "422": { @@ -1893,8 +1886,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1902,10 +1895,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "200": { - "description": "Request updated.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1917,13 +1917,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", @@ -1940,8 +1940,8 @@ } } }, - "404": { - "description": "No payment option found.", + "209": { + "description": "Request updated with a payment in progress.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -1953,7 +1953,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentsModelResponse" } } } @@ -2017,8 +2017,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2035,8 +2035,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2064,8 +2064,8 @@ } } }, - "422": { - "description": "Unprocessable: not in payable state.", + "404": { + "description": "No payment option found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2082,8 +2082,8 @@ } } }, - "200": { - "description": "Request paid.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2095,13 +2095,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentsModelResponse" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No payment option found.", + "422": { + "description": "Unprocessable: not in payable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2118,8 +2118,8 @@ } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Request paid.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2131,7 +2131,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentsModelResponse" } } } @@ -2157,10 +2157,10 @@ } ] }, - "/organizations/{organizationfiscalcode}/transfers/update/iban": { - "post": { + "/organizations/{organizationfiscalcode}/transfers": { + "patch": { "tags": [ - "Payments API" + "Debt Positions API" ], "summary": "The Organization updates the IBANs of every updatable payment option's transfers", "operationId": "updateTransferIbanMassive", @@ -2173,6 +2173,15 @@ "schema": { "type": "string" } + }, + { + "name": "oldIban", + "in": "query", + "description": "The old iban to replace", + "required": true, + "schema": { + "type": "string" + } } ], "requestBody": { @@ -2204,8 +2213,8 @@ } } }, - "404": { - "description": "No debt position in updatable state found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2213,13 +2222,6 @@ "type": "string" } } - }, - "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, "400": { @@ -2240,8 +2242,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "200": { + "description": "IBANs updated", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2249,10 +2251,17 @@ "type": "string" } } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } } }, - "200": { - "description": "IBANs updated", + "404": { + "description": "No debt position in updatable state found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2264,7 +2273,7 @@ "content": { "text/plain": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ProblemJson" } } } @@ -2438,8 +2447,8 @@ } } }, - "429": { - "description": "Too many requests.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2449,8 +2458,8 @@ } } }, - "400": { - "description": "Malformed request.", + "200": { + "description": "Obtained all organization payment positions.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2462,13 +2471,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionsInfoV3" } } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2476,10 +2485,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "200": { - "description": "Obtained all organization payment positions.", + "429": { + "description": "Too many requests.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2487,13 +2503,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionsInfoV3" - } - } } } }, @@ -2573,8 +2582,8 @@ } } }, - "400": { - "description": "Malformed request.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2582,17 +2591,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "201": { - "description": "Request created.", + "409": { + "description": "Conflict: duplicate debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2604,13 +2606,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Wrong or missing function key.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2618,10 +2620,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: duplicate debt position found.", + "201": { + "description": "Request created.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2633,7 +2642,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelV3" } } } @@ -2686,8 +2695,8 @@ } ], "responses": { - "500": { - "description": "Service unavailable.", + "200": { + "description": "Obtained debt position details.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2699,13 +2708,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelResponseV3" } } } }, - "200": { - "description": "Obtained debt position details.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2717,7 +2726,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaymentPositionModelResponseV3" + "$ref": "#/components/schemas/ProblemJson" } } } @@ -2804,8 +2813,8 @@ "required": true }, "responses": { - "500": { - "description": "Service unavailable.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2822,8 +2831,8 @@ } } }, - "400": { - "description": "Malformed request.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2840,8 +2849,8 @@ } } }, - "200": { - "description": "Debt Position updated.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2849,17 +2858,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModelV3" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2867,10 +2869,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "200": { + "description": "Debt Position updated.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2882,13 +2891,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemJson" + "$ref": "#/components/schemas/PaymentPositionModelV3" } } } }, - "404": { - "description": "No debt position found.", + "400": { + "description": "Malformed request.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2959,8 +2968,8 @@ } } }, - "500": { - "description": "Service unavailable.", + "404": { + "description": "No debt position position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2977,8 +2986,8 @@ } } }, - "404": { - "description": "No debt position position found.", + "409": { + "description": "Conflict: existing related payment found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -2995,8 +3004,8 @@ } } }, - "401": { - "description": "Wrong or missing function key.", + "500": { + "description": "Service unavailable.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -3004,10 +3013,17 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, - "409": { - "description": "Conflict: existing related payment found.", + "401": { + "description": "Wrong or missing function key.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -3015,13 +3031,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } } }, @@ -3088,8 +3097,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", @@ -3097,17 +3106,10 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } } }, - "401": { - "description": "Wrong or missing function key.", + "404": { + "description": "No debt position found.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -3115,6 +3117,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } } }, "200": { @@ -3135,8 +3144,8 @@ } } }, - "404": { - "description": "No debt position found.", + "409": { + "description": "Conflict: debt position is not in publishable state.", "headers": { "X-Request-Id": { "description": "This header identifies the call", @@ -3917,21 +3926,6 @@ } } }, - "UpdateTransferIbanMassiveModel": { - "required": [ - "newIban", - "oldIban" - ], - "type": "object", - "properties": { - "oldIban": { - "type": "string" - }, - "newIban": { - "type": "string" - } - } - }, "PayPaymentOptionModel": { "required": [ "idReceipt", @@ -3957,6 +3951,17 @@ } } }, + "UpdateTransferIbanMassiveModel": { + "required": [ + "newIban" + ], + "type": "object", + "properties": { + "newIban": { + "type": "string" + } + } + }, "InstallmentModelResponse": { "type": "object", "properties": { diff --git a/openapi/openapi_send.json b/openapi/openapi_send.json index 40991fb4..8eabc27c 100644 --- a/openapi/openapi_send.json +++ b/openapi/openapi_send.json @@ -1,833 +1,766 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Debt Position", - "description": "Progetto Gestione Posizioni Debitorie", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.12.1" + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Debt Position", + "description" : "Progetto Gestione Posizioni Debitorie", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "0.12.1" }, - "servers": [ - { - "url": "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v1/", - "description": "GPD Test environment" - }, - { - "url": "https://api.platform.pagopa.it/gpd/debt-positions-service/v1/", - "description": "GPD Production Environment" - }, - { - "url": "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v3/", - "description": "GPD Test environment" - }, - { - "url": "https://api.platform.pagopa.it/gpd/debt-positions-service/v3/", - "description": "GPD Production Environment" - }, - { - "url": "https://api.uat.platform.pagopa.it/aca/debt-positions-service/v1/", - "description": "ACA Test environment" - }, - { - "url": "https://api.platform.pagopa.it/aca/debt-positions-service/v1/", - "description": "ACA Production environment" - } - ], - "tags": [ - { - "name": "Payments API" - } - ], - "paths": { - "/organizations/{organizationfiscalcode}/paymentoptions/{nav}/notificationfee": { - "put": { - "tags": [ - "Payments API" - ], - "summary": "The organization updates the notification fee of a payment option.", - "operationId": "updateNotificationFee", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "nav", - "in": "path", - "description": "NAV (notice number) is the unique reference assigned to the payment by a creditor institution.", - "required": true, - "schema": { - "type": "string" - } + "servers" : [ { + "url" : "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v1/", + "description" : "GPD Test environment" + }, { + "url" : "https://api.platform.pagopa.it/gpd/debt-positions-service/v1/", + "description" : "GPD Production Environment" + }, { + "url" : "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v3/", + "description" : "GPD Test environment" + }, { + "url" : "https://api.platform.pagopa.it/gpd/debt-positions-service/v3/", + "description" : "GPD Production Environment" + }, { + "url" : "https://api.uat.platform.pagopa.it/aca/debt-positions-service/v1/", + "description" : "ACA Test environment" + }, { + "url" : "https://api.platform.pagopa.it/aca/debt-positions-service/v1/", + "description" : "ACA Production environment" + } ], + "tags" : [ { + "name" : "Payments API" + } ], + "paths" : { + "/organizations/{organizationfiscalcode}/paymentoptions/{nav}/notificationfee" : { + "put" : { + "tags" : [ "Payments API" ], + "summary" : "The organization updates the notification fee of a payment option.", + "operationId" : "updateNotificationFee", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "nav", + "in" : "path", + "description" : "NAV (notice number) is the unique reference assigned to the payment by a creditor institution.", + "required" : true, + "schema" : { + "type" : "string" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationFeeUpdateModel" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/NotificationFeeUpdateModel" } } }, - "required": true + "required" : true }, - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "responses" : { + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Malformed request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "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" } } } }, - "422": { - "description": "Unprocessable payment option.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "422" : { + "description" : "Unprocessable payment option.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "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" + "404" : { + "description" : "No payment option found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Request updated.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "400" : { + "description" : "Malformed request.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentsModelResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "209": { - "description": "Request updated with a payment in progress.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Request updated.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentsModelResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentsModelResponse" } } } }, - "404": { - "description": "No payment option found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "209" : { + "description" : "Request updated with a payment in progress.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentsModelResponse" } } } } }, - "security": [ - { - "ApiKey": [] - }, - { - "Authorization": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + }, { + "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" - } + "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}/paymentoptions/{nav}": { - "get": { - "tags": [ - "Payments API" - ], - "summary": "Return the details of a specific payment option.", - "operationId": "getOrganizationPaymentOptionByNAV", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "pattern": "\\d{1,30}", - "type": "string" - } - }, - { - "name": "nav", - "in": "path", - "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" - } + "/organizations/{organizationfiscalcode}/paymentoptions/{nav}" : { + "get" : { + "tags" : [ "Payments API" ], + "summary" : "Return the details of a specific payment option.", + "operationId" : "getOrganizationPaymentOptionByNAV", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "pattern" : "\\d{1,30}", + "type" : "string" + } + }, { + "name" : "nav", + "in" : "path", + "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" } - ], - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + } ], + "responses" : { + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Obtained payment option details.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentsWithDebtorInfoModelResponse" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "No payment option found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No payment option found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Obtained payment option details.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentsWithDebtorInfoModelResponse" } } } } }, - "security": [ - { - "ApiKey": [] - }, - { - "Authorization": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + }, { + "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" - } + "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" } - ] + } ] }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "OK.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "403": { - "description": "Forbidden.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "OK.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "403" : { + "description" : "Forbidden.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } } }, - "security": [ - { - "ApiKey": [] - }, - { - "Authorization": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + }, { + "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" - } + "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" } - ] + } ] } }, - "components": { - "schemas": { - "NotificationFeeUpdateModel": { - "required": [ - "notificationFee" - ], - "type": "object", - "properties": { - "notificationFee": { - "type": "integer", - "format": "int64" + "components" : { + "schemas" : { + "NotificationFeeUpdateModel" : { + "required" : [ "notificationFee" ], + "type" : "object", + "properties" : { + "notificationFee" : { + "type" : "integer", + "format" : "int64" } } }, - "ProblemJson": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" - }, - "status": { - "maximum": 600, - "minimum": 100, - "type": "integer", - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "format": "int32", - "example": 200 - }, - "detail": { - "type": "string", - "description": "A human readable explanation specific to this occurrence of the problem.", - "example": "There was an error processing the request" + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 + }, + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" } } }, - "PaymentOptionMetadataModelResponse": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "PaymentOptionMetadataModelResponse" : { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" } } }, - "PaymentsModelResponse": { - "type": "object", - "properties": { - "nav": { - "type": "string" + "PaymentsModelResponse" : { + "type" : "object", + "properties" : { + "nav" : { + "type" : "string" }, - "iuv": { - "type": "string" + "iuv" : { + "type" : "string" }, - "organizationFiscalCode": { - "type": "string" + "organizationFiscalCode" : { + "type" : "string" }, - "amount": { - "type": "integer", - "format": "int64" + "amount" : { + "type" : "integer", + "format" : "int64" }, - "description": { - "type": "string" + "description" : { + "type" : "string" }, - "isPartialPayment": { - "type": "boolean" + "isPartialPayment" : { + "type" : "boolean" }, - "dueDate": { - "type": "string", - "format": "date-time" + "dueDate" : { + "type" : "string", + "format" : "date-time" }, - "retentionDate": { - "type": "string", - "format": "date-time" + "retentionDate" : { + "type" : "string", + "format" : "date-time" }, - "paymentDate": { - "type": "string", - "format": "date-time" + "paymentDate" : { + "type" : "string", + "format" : "date-time" }, - "reportingDate": { - "type": "string", - "format": "date-time" + "reportingDate" : { + "type" : "string", + "format" : "date-time" }, - "insertedDate": { - "type": "string", - "format": "date-time" + "insertedDate" : { + "type" : "string", + "format" : "date-time" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "fee": { - "type": "integer", - "format": "int64" + "fee" : { + "type" : "integer", + "format" : "int64" }, - "notificationFee": { - "type": "integer", - "format": "int64" + "notificationFee" : { + "type" : "integer", + "format" : "int64" }, - "pspCompany": { - "type": "string" + "pspCompany" : { + "type" : "string" }, - "idReceipt": { - "type": "string" + "idReceipt" : { + "type" : "string" }, - "idFlowReporting": { - "type": "string" + "idFlowReporting" : { + "type" : "string" }, - "status": { - "type": "string", - "enum": [ - "PO_UNPAID", - "PO_PAID", - "PO_PARTIALLY_REPORTED", - "PO_REPORTED" - ] + "status" : { + "type" : "string", + "enum" : [ "PO_UNPAID", "PO_PAID", "PO_PARTIALLY_REPORTED", "PO_REPORTED" ] }, - "lastUpdatedDate": { - "type": "string", - "format": "date-time" + "lastUpdatedDate" : { + "type" : "string", + "format" : "date-time" }, - "lastUpdatedDateNotificationFee": { - "type": "string", - "format": "date-time" + "lastUpdatedDateNotificationFee" : { + "type" : "string", + "format" : "date-time" }, - "paymentOptionMetadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentOptionMetadataModelResponse" + "paymentOptionMetadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentOptionMetadataModelResponse" } }, - "transfer": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferModelResponse" + "transfer" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferModelResponse" } } } }, - "Stamp": { - "required": [ - "hashDocument", - "provincialResidence", - "stampType" - ], - "type": "object", - "properties": { - "hashDocument": { - "maxLength": 72, - "minLength": 0, - "type": "string", - "description": "Document hash type is stBase64Binary72 as described in https://github.com/pagopa/pagopa-api." - }, - "stampType": { - "maxLength": 2, - "minLength": 2, - "type": "string", - "description": "The type of the stamp" - }, - "provincialResidence": { - "pattern": "[A-Z]{2}", - "type": "string", - "description": "The provincial of the residence", - "example": "RM" + "Stamp" : { + "required" : [ "hashDocument", "provincialResidence", "stampType" ], + "type" : "object", + "properties" : { + "hashDocument" : { + "maxLength" : 72, + "minLength" : 0, + "type" : "string", + "description" : "Document hash type is stBase64Binary72 as described in https://github.com/pagopa/pagopa-api." + }, + "stampType" : { + "maxLength" : 2, + "minLength" : 2, + "type" : "string", + "description" : "The type of the stamp" + }, + "provincialResidence" : { + "pattern" : "[A-Z]{2}", + "type" : "string", + "description" : "The provincial of the residence", + "example" : "RM" } } }, - "TransferMetadataModelResponse": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "TransferMetadataModelResponse" : { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" } } }, - "TransferModelResponse": { - "type": "object", - "properties": { - "organizationFiscalCode": { - "type": "string" + "TransferModelResponse" : { + "type" : "object", + "properties" : { + "organizationFiscalCode" : { + "type" : "string" }, - "companyName": { - "type": "string" + "companyName" : { + "type" : "string" }, - "idTransfer": { - "type": "string" + "idTransfer" : { + "type" : "string" }, - "amount": { - "type": "integer", - "format": "int64" + "amount" : { + "type" : "integer", + "format" : "int64" }, - "remittanceInformation": { - "type": "string" + "remittanceInformation" : { + "type" : "string" }, - "category": { - "type": "string" + "category" : { + "type" : "string" }, - "iban": { - "type": "string" + "iban" : { + "type" : "string" }, - "postalIban": { - "type": "string" + "postalIban" : { + "type" : "string" }, - "stamp": { - "$ref": "#/components/schemas/Stamp" + "stamp" : { + "$ref" : "#/components/schemas/Stamp" }, - "insertedDate": { - "type": "string", - "format": "date-time" + "insertedDate" : { + "type" : "string", + "format" : "date-time" }, - "status": { - "type": "string", - "enum": [ - "T_UNREPORTED", - "T_REPORTED" - ] + "status" : { + "type" : "string", + "enum" : [ "T_UNREPORTED", "T_REPORTED" ] }, - "lastUpdatedDate": { - "type": "string", - "format": "date-time" + "lastUpdatedDate" : { + "type" : "string", + "format" : "date-time" }, - "transferMetadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferMetadataModelResponse" + "transferMetadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferMetadataModelResponse" } } } }, - "PaymentsWithDebtorInfoModelResponse": { - "type": "object", - "properties": { - "nav": { - "type": "string" + "PaymentsWithDebtorInfoModelResponse" : { + "type" : "object", + "properties" : { + "nav" : { + "type" : "string" }, - "iuv": { - "type": "string" + "iuv" : { + "type" : "string" }, - "organizationFiscalCode": { - "type": "string" + "organizationFiscalCode" : { + "type" : "string" }, - "amount": { - "type": "integer", - "format": "int64" + "amount" : { + "type" : "integer", + "format" : "int64" }, - "description": { - "type": "string" + "description" : { + "type" : "string" }, - "isPartialPayment": { - "type": "boolean" + "isPartialPayment" : { + "type" : "boolean" }, - "dueDate": { - "type": "string", - "format": "date-time" + "dueDate" : { + "type" : "string", + "format" : "date-time" }, - "retentionDate": { - "type": "string", - "format": "date-time" + "retentionDate" : { + "type" : "string", + "format" : "date-time" }, - "paymentDate": { - "type": "string", - "format": "date-time" + "paymentDate" : { + "type" : "string", + "format" : "date-time" }, - "reportingDate": { - "type": "string", - "format": "date-time" + "reportingDate" : { + "type" : "string", + "format" : "date-time" }, - "insertedDate": { - "type": "string", - "format": "date-time" + "insertedDate" : { + "type" : "string", + "format" : "date-time" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "fee": { - "type": "integer", - "format": "int64" + "fee" : { + "type" : "integer", + "format" : "int64" }, - "notificationFee": { - "type": "integer", - "format": "int64" + "notificationFee" : { + "type" : "integer", + "format" : "int64" }, - "pspCompany": { - "type": "string" + "pspCompany" : { + "type" : "string" }, - "idReceipt": { - "type": "string" + "idReceipt" : { + "type" : "string" }, - "idFlowReporting": { - "type": "string" + "idFlowReporting" : { + "type" : "string" }, - "status": { - "type": "string", - "enum": [ - "PO_UNPAID", - "PO_PAID", - "PO_PARTIALLY_REPORTED", - "PO_REPORTED" - ] + "status" : { + "type" : "string", + "enum" : [ "PO_UNPAID", "PO_PAID", "PO_PARTIALLY_REPORTED", "PO_REPORTED" ] }, - "paymentOptionMetadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentOptionMetadataModelResponse" + "paymentOptionMetadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentOptionMetadataModelResponse" } }, - "iupd": { - "type": "string" + "iupd" : { + "type" : "string" }, - "type": { - "type": "string", - "enum": [ - "F", - "G" - ] + "type" : { + "type" : "string", + "enum" : [ "F", "G" ] }, - "fiscalCode": { - "type": "string" + "fiscalCode" : { + "type" : "string" }, - "fullName": { - "type": "string" + "fullName" : { + "type" : "string" }, - "streetName": { - "type": "string" + "streetName" : { + "type" : "string" }, - "civicNumber": { - "type": "string" + "civicNumber" : { + "type" : "string" }, - "postalCode": { - "type": "string" + "postalCode" : { + "type" : "string" }, - "city": { - "type": "string" + "city" : { + "type" : "string" }, - "province": { - "type": "string" + "province" : { + "type" : "string" }, - "region": { - "type": "string" + "region" : { + "type" : "string" }, - "country": { - "type": "string" + "country" : { + "type" : "string" }, - "email": { - "type": "string" + "email" : { + "type" : "string" }, - "phone": { - "type": "string" + "phone" : { + "type" : "string" }, - "companyName": { - "type": "string" + "companyName" : { + "type" : "string" }, - "officeName": { - "type": "string" + "officeName" : { + "type" : "string" }, - "debtPositionStatus": { - "type": "string", - "enum": [ - "DRAFT", - "PUBLISHED", - "VALID", - "INVALID", - "EXPIRED", - "PARTIALLY_PAID", - "PAID", - "REPORTED" - ] + "debtPositionStatus" : { + "type" : "string", + "enum" : [ "DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED" ] }, - "transfer": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferModelResponse" + "transfer" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferModelResponse" } } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" }, - "Authorization": { - "type": "http", - "description": "JWT token get after Azure Login", - "scheme": "bearer", - "bearerFormat": "JWT" + "Authorization" : { + "type" : "http", + "description" : "JWT token get after Azure Login", + "scheme" : "bearer", + "bearerFormat" : "JWT" } } } -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/debtposition/controller/payments/api/IPaymentsController.java b/src/main/java/it/gov/pagopa/debtposition/controller/payments/api/IPaymentsController.java index 778c506c..32fbfab6 100644 --- a/src/main/java/it/gov/pagopa/debtposition/controller/payments/api/IPaymentsController.java +++ b/src/main/java/it/gov/pagopa/debtposition/controller/payments/api/IPaymentsController.java @@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import it.gov.pagopa.debtposition.model.ProblemJson; import it.gov.pagopa.debtposition.model.payments.PaymentOptionModel; -import it.gov.pagopa.debtposition.model.payments.UpdateTransferIbanMassiveModel; import it.gov.pagopa.debtposition.model.payments.response.PaymentOptionModelResponse; import it.gov.pagopa.debtposition.model.payments.response.PaymentOptionWithDebtorInfoModelResponse; import it.gov.pagopa.debtposition.model.pd.NotificationFeeUpdateModel; @@ -267,49 +266,4 @@ ResponseEntity updateNotificationFee( @PathVariable("nav") String nav, @Valid @RequestBody NotificationFeeUpdateModel notificationFeeUpdateModel); - - @Operation( - summary = "The Organization updates the IBANs of every updatable payment option's transfers", - security = { - @SecurityRequirement(name = "ApiKey"), - @SecurityRequirement(name = "Authorization") - }, - operationId = "updateTransferIbanMassive") - @ApiResponses( - value = { - @ApiResponse(responseCode = "200", description = "IBANs updated"), - @ApiResponse( - responseCode = "400", - description = "Malformed request.", - content = - @Content( - mediaType = MediaType.APPLICATION_JSON_VALUE, - schema = @Schema(implementation = ProblemJson.class))), - @ApiResponse( - responseCode = "401", - description = "Wrong or missing function key.", - content = @Content(schema = @Schema())), - @ApiResponse( - responseCode = "404", - description = "No debt position in updatable state found.", - content = @Content(schema = @Schema(implementation = ProblemJson.class))), - @ApiResponse( - responseCode = "500", - description = "Service unavailable.", - content = - @Content( - mediaType = MediaType.APPLICATION_JSON_VALUE, - schema = @Schema(implementation = ProblemJson.class))) - }) - @PostMapping( - value = "/organizations/{organizationfiscalcode}/transfers/update/iban", - produces = {MediaType.TEXT_PLAIN_VALUE}, - consumes = {MediaType.APPLICATION_JSON_VALUE}) - ResponseEntity updateTransferIbanMassive( - @Parameter( - description = "Organization fiscal code, the fiscal code of the Organization.", - required = true) - @PathVariable("organizationfiscalcode") - String organizationFiscalCode, - @Valid @RequestBody UpdateTransferIbanMassiveModel updateTransferIbanMassiveModel); } diff --git a/src/main/java/it/gov/pagopa/debtposition/controller/payments/api/impl/PaymentsController.java b/src/main/java/it/gov/pagopa/debtposition/controller/payments/api/impl/PaymentsController.java index 587a0098..44b4798e 100644 --- a/src/main/java/it/gov/pagopa/debtposition/controller/payments/api/impl/PaymentsController.java +++ b/src/main/java/it/gov/pagopa/debtposition/controller/payments/api/impl/PaymentsController.java @@ -6,7 +6,6 @@ import it.gov.pagopa.debtposition.exception.AppError; import it.gov.pagopa.debtposition.exception.AppException; import it.gov.pagopa.debtposition.model.payments.PaymentOptionModel; -import it.gov.pagopa.debtposition.model.payments.UpdateTransferIbanMassiveModel; import it.gov.pagopa.debtposition.model.payments.response.PaymentOptionModelResponse; import it.gov.pagopa.debtposition.model.payments.response.PaymentOptionWithDebtorInfoModelResponse; import it.gov.pagopa.debtposition.model.pd.NotificationFeeUpdateModel; @@ -21,7 +20,6 @@ import org.modelmapper.ModelMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; @@ -145,30 +143,4 @@ public ResponseEntity updateNotificationFee( throw new AppException( AppError.PAYMENT_OPTION_NOTIFICATION_FEE_UPDATE_FAILED, organizationFiscalCode, iuv); } - - @Override - public ResponseEntity updateTransferIbanMassive( - String organizationFiscalCode, - @Valid UpdateTransferIbanMassiveModel updateTransferIbanMassiveModel) { - log.debug( - String.format( - LOG_BASE_HEADER_INFO, - "POST", - "updateTransferIbanMassive", - String.format( - "organizationFiscalCode= %s; oldIban= %s; newIban= %s", - CommonUtil.sanitize(organizationFiscalCode), - CommonUtil.sanitize(updateTransferIbanMassiveModel.getOldIban()), - CommonUtil.sanitize(updateTransferIbanMassiveModel.getNewIban())))); - - int numberOfUpdates = - paymentsService.updateTransferIbanMassive( - organizationFiscalCode, - updateTransferIbanMassiveModel.getOldIban(), - updateTransferIbanMassiveModel.getNewIban()); - - return ResponseEntity.status(HttpStatus.OK.value()) - .contentType(MediaType.TEXT_PLAIN) - .body(String.format("Updated IBAN on %s Transfers", numberOfUpdates)); - } } diff --git a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v1/DebtPositionController.java b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v1/DebtPositionController.java index f771f278..4532be8b 100644 --- a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v1/DebtPositionController.java +++ b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v1/DebtPositionController.java @@ -13,6 +13,7 @@ import it.gov.pagopa.debtposition.model.filterandorder.FilterAndOrder; import it.gov.pagopa.debtposition.model.filterandorder.Order; import it.gov.pagopa.debtposition.model.filterandorder.Order.PaymentPositionOrder; +import it.gov.pagopa.debtposition.model.payments.UpdateTransferIbanMassiveModel; import it.gov.pagopa.debtposition.model.pd.MultipleIUPDModel; import it.gov.pagopa.debtposition.model.pd.MultiplePaymentPositionModel; import it.gov.pagopa.debtposition.model.pd.PaymentPositionModel; @@ -36,6 +37,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Sort.Direction; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.util.CollectionUtils; @@ -387,4 +389,19 @@ public ResponseEntity getDebtPositionByIUV( return new ResponseEntity<>(paymentPositionResponse, HttpStatus.OK); } + + @Override + public ResponseEntity updateTransferIbanMassive( + String organizationFiscalCode, + String oldIban, + UpdateTransferIbanMassiveModel updateTransferIbanMassiveModel) { + + int numberOfUpdates = + paymentPositionService.updateTransferIbanMassive( + organizationFiscalCode, oldIban, updateTransferIbanMassiveModel.getNewIban()); + + return ResponseEntity.status(HttpStatus.OK.value()) + .contentType(MediaType.TEXT_PLAIN) + .body(String.format("Updated IBAN on %s Transfers", numberOfUpdates)); + } } diff --git a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v1/IDebtPositionController.java b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v1/IDebtPositionController.java index 23f17641..d72922d2 100644 --- a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v1/IDebtPositionController.java +++ b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v1/IDebtPositionController.java @@ -12,6 +12,7 @@ import it.gov.pagopa.debtposition.model.enumeration.DebtPositionStatus; import it.gov.pagopa.debtposition.model.enumeration.ServiceType; import it.gov.pagopa.debtposition.model.filterandorder.Order; +import it.gov.pagopa.debtposition.model.payments.UpdateTransferIbanMassiveModel; import it.gov.pagopa.debtposition.model.pd.MultipleIUPDModel; import it.gov.pagopa.debtposition.model.pd.MultiplePaymentPositionModel; import it.gov.pagopa.debtposition.model.pd.PaymentPositionModel; @@ -25,14 +26,7 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.*; @Tag(name = "Debt Positions API") @Validated @@ -627,4 +621,50 @@ ResponseEntity getDebtPositionByIUV( @Pattern(regexp = "\\d{2}(,\\d{2})*") @RequestParam(required = false) String segregationCodes); + + @Operation( + summary = "The Organization updates the IBANs of every updatable payment option's transfers", + security = { + @SecurityRequirement(name = "ApiKey"), + @SecurityRequirement(name = "Authorization") + }, + operationId = "updateTransferIbanMassive") + @ApiResponses( + value = { + @ApiResponse(responseCode = "200", description = "IBANs updated"), + @ApiResponse( + responseCode = "400", + description = "Malformed request.", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))), + @ApiResponse( + responseCode = "401", + description = "Wrong or missing function key.", + content = @Content(schema = @Schema())), + @ApiResponse( + responseCode = "404", + description = "No debt position in updatable state found.", + content = @Content(schema = @Schema(implementation = ProblemJson.class))), + @ApiResponse( + responseCode = "500", + description = "Service unavailable.", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))) + }) + @PatchMapping( + value = "/organizations/{organizationfiscalcode}/transfers", + produces = {MediaType.TEXT_PLAIN_VALUE}, + consumes = {MediaType.APPLICATION_JSON_VALUE}) + ResponseEntity updateTransferIbanMassive( + @Parameter( + description = "Organization fiscal code, the fiscal code of the Organization.", + required = true) + @PathVariable("organizationfiscalcode") + String organizationFiscalCode, + @Parameter(description = "The old iban to replace") @RequestParam @NotBlank String oldIban, + @Valid @RequestBody UpdateTransferIbanMassiveModel updateTransferIbanMassiveModel); } diff --git a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v3/IDebtPositionControllerV3.java b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v3/IDebtPositionControllerV3.java index abf6caa6..f723eb55 100644 --- a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v3/IDebtPositionControllerV3.java +++ b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/v3/IDebtPositionControllerV3.java @@ -17,10 +17,7 @@ import it.gov.pagopa.debtposition.model.v3.response.PaymentPositionModelResponseV3; import java.time.LocalDate; import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Positive; +import javax.validation.constraints.*; import org.springframework.data.domain.Sort; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.http.MediaType; diff --git a/src/main/java/it/gov/pagopa/debtposition/model/enumeration/DebtPositionStatus.java b/src/main/java/it/gov/pagopa/debtposition/model/enumeration/DebtPositionStatus.java index e0f92647..d2c519f1 100644 --- a/src/main/java/it/gov/pagopa/debtposition/model/enumeration/DebtPositionStatus.java +++ b/src/main/java/it/gov/pagopa/debtposition/model/enumeration/DebtPositionStatus.java @@ -2,6 +2,8 @@ import it.gov.pagopa.debtposition.entity.PaymentOption; import it.gov.pagopa.debtposition.entity.PaymentPosition; +import it.gov.pagopa.debtposition.exception.AppError; +import it.gov.pagopa.debtposition.exception.AppException; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.EnumSet; @@ -93,4 +95,24 @@ public static PaymentPosition expirationCheckAndUpdate(PaymentOption po) { } return pp; } + + /** + * Checks if the user is trying to pay the full amount for the payment position but there is an + * installment already paid, in which case + * + * @param paymentOptionToPay the payment option being paid + * @param nav the identifier of the notice being paid + */ + public static void checkAlreadyPaidInstallments(PaymentOption paymentOptionToPay, String nav) { + + PaymentPosition paymentPosition = paymentOptionToPay.getPaymentPosition(); + if (Boolean.FALSE.equals(paymentOptionToPay.getIsPartialPayment()) + && paymentPosition.getStatus().equals(DebtPositionStatus.PARTIALLY_PAID)) { + + throw new AppException( + AppError.PAYMENT_OPTION_ALREADY_PAID, + paymentOptionToPay.getOrganizationFiscalCode(), + nav); + } + } } diff --git a/src/main/java/it/gov/pagopa/debtposition/model/payments/UpdateTransferIbanMassiveModel.java b/src/main/java/it/gov/pagopa/debtposition/model/payments/UpdateTransferIbanMassiveModel.java index a2a915e3..2d661f72 100644 --- a/src/main/java/it/gov/pagopa/debtposition/model/payments/UpdateTransferIbanMassiveModel.java +++ b/src/main/java/it/gov/pagopa/debtposition/model/payments/UpdateTransferIbanMassiveModel.java @@ -12,6 +12,5 @@ @NoArgsConstructor public class UpdateTransferIbanMassiveModel { - @NotNull private String oldIban; @NotNull private String newIban; } diff --git a/src/main/java/it/gov/pagopa/debtposition/service/payments/PaymentsService.java b/src/main/java/it/gov/pagopa/debtposition/service/payments/PaymentsService.java index 1a52e2a6..7c1710bc 100644 --- a/src/main/java/it/gov/pagopa/debtposition/service/payments/PaymentsService.java +++ b/src/main/java/it/gov/pagopa/debtposition/service/payments/PaymentsService.java @@ -22,10 +22,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneOffset; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; +import java.util.*; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -77,6 +74,7 @@ public PaymentOption getPaymentOptionByNAV( // PaymentPosition used when converting PaymentOption to POWithDebtor DebtPositionStatus.validityCheckAndUpdate(paymentOption); DebtPositionStatus.expirationCheckAndUpdate(paymentOption); + DebtPositionStatus.checkAlreadyPaidInstallments(paymentOption, nav); return paymentOption; } @@ -295,7 +293,11 @@ private PaymentOption updatePaymentStatus( } // aggiorno lo stato della payment position - if (countPaidPartialPayment > 0 && countPaidPartialPayment < numberOfPartialPayment) { + // PIDM-42 if paying the full amount when there is already a paid partial payment + // then update the payment position status to PAID + if (countPaidPartialPayment > 0 + && countPaidPartialPayment < numberOfPartialPayment + && Boolean.TRUE.equals(Objects.requireNonNull(poToPay).getIsPartialPayment())) { pp.setStatus(DebtPositionStatus.PARTIALLY_PAID); } else { pp.setStatus(DebtPositionStatus.PAID); @@ -400,36 +402,4 @@ private void setPaymentPositionStatus(PaymentPosition pp) { pp.setStatus(DebtPositionStatus.REPORTED); } } - - // Update all Organization's IBANs on Transfer of payable PaymentPosition - @Transactional - public int updateTransferIbanMassive( - String organizationFiscalCode, String oldIban, String newIban) { - int numberOfUpdates = 0; - // Retrieve all payment_position with organization_fiscal_code AND in status (DRAFT or PUBLISHED - // or VALID or PARTIALLY_PAID) - List ppToUpdate = - paymentPositionRepository.findByOrganizationFiscalCodeAndStatusIn( - organizationFiscalCode, - List.of( - DebtPositionStatus.DRAFT, - DebtPositionStatus.PUBLISHED, - DebtPositionStatus.VALID, - DebtPositionStatus.PARTIALLY_PAID)); - if (ppToUpdate.isEmpty()) { - throw new AppException( - AppError.DEBT_POSITION_IN_UPDATABLE_STATE_NOT_FOUND, organizationFiscalCode); - } - // Retrieve all payment_option with payment_position_id AND in status PO_UNPAID - List poToUpdate = - paymentOptionRepository.findByPaymentPositionInAndStatusIn( - ppToUpdate, List.of(PaymentOptionStatus.PO_UNPAID)); - - // Update all Transfers that have the specified payment_option_id and oldIban as IBAN - numberOfUpdates += - transferRepository.updateTransferIban( - poToUpdate, oldIban, newIban, LocalDateTime.now(ZoneOffset.UTC)); - - return numberOfUpdates; - } } diff --git a/src/main/java/it/gov/pagopa/debtposition/service/pd/crud/PaymentPositionCRUDService.java b/src/main/java/it/gov/pagopa/debtposition/service/pd/crud/PaymentPositionCRUDService.java index efae781b..6b6f3bc0 100644 --- a/src/main/java/it/gov/pagopa/debtposition/service/pd/crud/PaymentPositionCRUDService.java +++ b/src/main/java/it/gov/pagopa/debtposition/service/pd/crud/PaymentPositionCRUDService.java @@ -13,6 +13,7 @@ import it.gov.pagopa.debtposition.model.filterandorder.FilterAndOrder; import it.gov.pagopa.debtposition.repository.PaymentOptionRepository; import it.gov.pagopa.debtposition.repository.PaymentPositionRepository; +import it.gov.pagopa.debtposition.repository.TransferRepository; import it.gov.pagopa.debtposition.repository.specification.*; import it.gov.pagopa.debtposition.service.payments.PaymentsService; import it.gov.pagopa.debtposition.util.CommonUtil; @@ -52,6 +53,7 @@ public class PaymentPositionCRUDService { @Autowired private PaymentPositionRepository paymentPositionRepository; @Autowired private PaymentOptionRepository paymentOptionRepository; @Autowired private ModelMapper modelMapper; + @Autowired private TransferRepository transferRepository; @Value("${nav.aux.digit}") private String auxDigit; @@ -437,6 +439,38 @@ public void checkAndUpdateDates(FilterAndOrder filterAndOrder) { filterAndOrder.getFilter().setPaymentDateTo(verifiedPaymentDates.get(1)); } + // Update all Organization's IBANs on Transfer of payable PaymentPosition + @Transactional + public int updateTransferIbanMassive( + String organizationFiscalCode, String oldIban, String newIban) { + int numberOfUpdates = 0; + // Retrieve all payment_position with organization_fiscal_code AND in status (DRAFT or PUBLISHED + // or VALID or PARTIALLY_PAID) + List ppToUpdate = + paymentPositionRepository.findByOrganizationFiscalCodeAndStatusIn( + organizationFiscalCode, + List.of( + DebtPositionStatus.DRAFT, + DebtPositionStatus.PUBLISHED, + DebtPositionStatus.VALID, + DebtPositionStatus.PARTIALLY_PAID)); + if (ppToUpdate.isEmpty()) { + throw new AppException( + AppError.DEBT_POSITION_IN_UPDATABLE_STATE_NOT_FOUND, organizationFiscalCode); + } + // Retrieve all payment_option with payment_position_id AND in status PO_UNPAID + List poToUpdate = + paymentOptionRepository.findByPaymentPositionInAndStatusIn( + ppToUpdate, List.of(PaymentOptionStatus.PO_UNPAID)); + + // Update all Transfers that have the specified payment_option_id and oldIban as IBAN + numberOfUpdates += + transferRepository.updateTransferIban( + poToUpdate, oldIban, newIban, LocalDateTime.now(ZoneOffset.UTC)); + + return numberOfUpdates; + } + private PaymentPosition checkAndBuildDebtPositionToSave( PaymentPosition debtPosition, String organizationFiscalCode, diff --git a/src/main/java/it/gov/pagopa/debtposition/util/DebtPositionValidation.java b/src/main/java/it/gov/pagopa/debtposition/util/DebtPositionValidation.java index a2aee4ee..cf60141a 100644 --- a/src/main/java/it/gov/pagopa/debtposition/util/DebtPositionValidation.java +++ b/src/main/java/it/gov/pagopa/debtposition/util/DebtPositionValidation.java @@ -270,10 +270,31 @@ private static void checkPaymentOptionPayable(PaymentPosition ppToPay, String na // La posizione debitoria è già in PARTIALLY_PAID ed arriva una richiesta di pagamento su una // payment option non rateizzata (isPartialPayment = false) => errore + // PIDM-42: if this is a full payment and the position is partially paid then + // log this but allow the payment option status to be changed to PO_PAID instead of throwing an + // error + // NOTE: the exception handling has been moved to the get/activate validation + // (checkAlreadyPaidInstallments) if (ppToPay.getStatus().equals(DebtPositionStatus.PARTIALLY_PAID) && Boolean.FALSE.equals(poToPay.getIsPartialPayment())) { - throw new AppException( - AppError.PAYMENT_OPTION_ALREADY_PAID, poToPay.getOrganizationFiscalCode(), nav); + + // log detailed information about this edge case + log.warn( + "Potential payment state inconsistency detected || " + + "Organization: {} || " + + "IUPD: {} || " + + "NAV: {} || " + + "Position Status: {} || " + + "Payment Option Status: {} || " + + "Is Partial Payment: {} || " + + "Timestamp: {}", + ppToPay.getOrganizationFiscalCode(), + ppToPay.getIupd(), + nav, + ppToPay.getStatus(), + poToPay.getStatus(), + poToPay.getIsPartialPayment(), + LocalDateTime.now()); } } diff --git a/src/test/java/it/gov/pagopa/debtposition/controller/DebtPositionControllerTest.java b/src/test/java/it/gov/pagopa/debtposition/controller/DebtPositionControllerTest.java index 39dc71ce..95f443c7 100644 --- a/src/test/java/it/gov/pagopa/debtposition/controller/DebtPositionControllerTest.java +++ b/src/test/java/it/gov/pagopa/debtposition/controller/DebtPositionControllerTest.java @@ -2,11 +2,10 @@ import static org.hamcrest.CoreMatchers.containsString; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -20,7 +19,9 @@ import it.gov.pagopa.debtposition.model.enumeration.DebtPositionStatus; import it.gov.pagopa.debtposition.model.enumeration.PaymentOptionStatus; import it.gov.pagopa.debtposition.model.enumeration.TransferStatus; +import it.gov.pagopa.debtposition.model.payments.UpdateTransferIbanMassiveModel; import it.gov.pagopa.debtposition.model.pd.Stamp; +import it.gov.pagopa.debtposition.service.pd.crud.PaymentPositionCRUDService; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; @@ -38,6 +39,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.boot.test.mock.mockito.SpyBean; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; @@ -49,6 +51,8 @@ class DebtPositionControllerTest { @Autowired private MockMvc mvc; + @SpyBean private PaymentPositionCRUDService paymentPositionService; + @Mock private ModelMapper modelMapperMock; @MockBean private NodeClient nodeClient; @@ -2164,4 +2168,59 @@ void updateDebtPosition_noValidTransfer_422() throws Exception { .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isUnprocessableEntity()); } + + /** UPDATE IBAN ON TRANSFERS */ + @Test + void updateTransferIbanMassive_200() throws Exception { + UpdateTransferIbanMassiveModel request = + UpdateTransferIbanMassiveModel.builder().newIban("XYZ").build(); + + doReturn(1) + .when(paymentPositionService) + .updateTransferIbanMassive("77777777777", "ABCDE", "XYZ"); + + mvc.perform( + patch("/organizations/77777777777/transfers?oldIban=ABCDE") + .content(TestUtil.toJson(request)) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.TEXT_PLAIN)) + .andExpect(content().string("Updated IBAN on 1 Transfers")); + } + + @Test + void updateTransferIbanMassive_404() throws Exception { + UpdateTransferIbanMassiveModel request = + UpdateTransferIbanMassiveModel.builder().newIban("XYZ").build(); + + mvc.perform( + patch("/organizations/notFoundOrg/transfers?oldIban=ABCDE") + .content(TestUtil.toJson(request)) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isNotFound()); + } + + @Test + void updateTransferIbanMassive_400_noOldIban() throws Exception { + UpdateTransferIbanMassiveModel request = + UpdateTransferIbanMassiveModel.builder().newIban("XYZ").build(); + + mvc.perform( + patch("/organizations/notFoundOrg/transfers") + .content(TestUtil.toJson(request)) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()); + } + + @Test + void updateTransferIbanMassive_400_noNewIban() throws Exception { + UpdateTransferIbanMassiveModel request = + UpdateTransferIbanMassiveModel.builder().newIban(null).build(); + + mvc.perform( + patch("/organizations/notFoundOrg/transfers?oldIban=ABCDE") + .content(TestUtil.toJson(request)) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isBadRequest()); + } } diff --git a/src/test/java/it/gov/pagopa/debtposition/controller/PaymentsControllerTest.java b/src/test/java/it/gov/pagopa/debtposition/controller/PaymentsControllerTest.java index 11f1af77..35e980c3 100644 --- a/src/test/java/it/gov/pagopa/debtposition/controller/PaymentsControllerTest.java +++ b/src/test/java/it/gov/pagopa/debtposition/controller/PaymentsControllerTest.java @@ -26,7 +26,6 @@ import it.gov.pagopa.debtposition.model.enumeration.DebtPositionStatus; import it.gov.pagopa.debtposition.model.enumeration.PaymentOptionStatus; import it.gov.pagopa.debtposition.model.enumeration.TransferStatus; -import it.gov.pagopa.debtposition.model.payments.UpdateTransferIbanMassiveModel; import it.gov.pagopa.debtposition.model.pd.NotificationFeeUpdateModel; import it.gov.pagopa.debtposition.service.payments.PaymentsService; import it.gov.pagopa.debtposition.util.CustomHttpStatus; @@ -613,7 +612,7 @@ void payPaymentOption_Multiple_Partial_409() throws Exception { } @Test - void payPaymentOption_Multiple_Partial2_409() throws Exception { + void getPaymentOption_Multiple_Partial_409() throws Exception { // creo una posizione debitoria (senza 'validity date' impostata e nav non valorizzato) con più // opzioni di pagamento mvc.perform( @@ -655,13 +654,12 @@ void payPaymentOption_Multiple_Partial2_409() throws Exception { MockMvcResultMatchers.jsonPath("$.status") .value(DebtPositionStatus.PARTIALLY_PAID.toString())); - // effettuo un nuovo pagamento sulla payment option non rateizzabile (isPartialPayment = false) - // e ottengo errore + // effettuo una GET/ACTIVATE sulla payment option corrispondente alla rata unica/intero importo + // e ottengo errore 409 mvc.perform( - post("/organizations/PAY_Multiple_Partial2_409_12345678901/paymentoptions/" + get("/organizations/PAY_Multiple_Partial2_409_12345678901/paymentoptions/" + auxDigit - + "123456IUVMULTIPLEMOCK3/pay") - .content(TestUtil.toJson(DebtPositionMock.getPayPOMock1())) + + "123456IUVMULTIPLEMOCK3") .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isConflict()); } @@ -2044,59 +2042,4 @@ void ValidationError_checkPaymentPositionAccountability_Transfer() throws Except fail("Not the expected exception: " + e.getMessage()); } } - - /** UPDATE IBAN ON TRANSFERS */ - @Test - void updateTransferIbanMassive_200() throws Exception { - UpdateTransferIbanMassiveModel request = - UpdateTransferIbanMassiveModel.builder().oldIban("oldIban").newIban("newIban").build(); - - doReturn(1) - .when(paymentsService) - .updateTransferIbanMassive("77777777777", "oldIban", "newIban"); - - mvc.perform( - post("/organizations/77777777777/transfers/update/iban") - .content(TestUtil.toJson(request)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.TEXT_PLAIN)) - .andExpect(content().string("Updated IBAN on 1 Transfers")); - } - - @Test - void updateTransferIbanMassive_404() throws Exception { - UpdateTransferIbanMassiveModel request = - UpdateTransferIbanMassiveModel.builder().oldIban("oldIban").newIban("newIban").build(); - - mvc.perform( - post("/organizations/notFoundOrg/transfers/update/iban") - .content(TestUtil.toJson(request)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNotFound()); - } - - @Test - void updateTransferIbanMassive_400_noOldIban() throws Exception { - UpdateTransferIbanMassiveModel request = - UpdateTransferIbanMassiveModel.builder().oldIban(null).newIban("newIban").build(); - - mvc.perform( - post("/organizations/notFoundOrg/transfers/update/iban") - .content(TestUtil.toJson(request)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - void updateTransferIbanMassive_400_noNewIban() throws Exception { - UpdateTransferIbanMassiveModel request = - UpdateTransferIbanMassiveModel.builder().oldIban("oldIban").newIban(null).build(); - - mvc.perform( - post("/organizations/notFoundOrg/transfers/update/iban") - .content(TestUtil.toJson(request)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } } diff --git a/src/test/java/it/gov/pagopa/debtposition/service/payments/PaymentsServiceTest.java b/src/test/java/it/gov/pagopa/debtposition/service/payments/PaymentsServiceTest.java index 27727943..16650512 100644 --- a/src/test/java/it/gov/pagopa/debtposition/service/payments/PaymentsServiceTest.java +++ b/src/test/java/it/gov/pagopa/debtposition/service/payments/PaymentsServiceTest.java @@ -12,6 +12,7 @@ import it.gov.pagopa.debtposition.repository.PaymentOptionRepository; import it.gov.pagopa.debtposition.repository.PaymentPositionRepository; import it.gov.pagopa.debtposition.repository.TransferRepository; +import it.gov.pagopa.debtposition.service.pd.crud.PaymentPositionCRUDService; import java.time.LocalDateTime; import java.util.List; import org.junit.jupiter.api.Test; @@ -22,7 +23,7 @@ @SpringBootTest(classes = DebtPositionApplication.class) class PaymentsServiceTest { - @Autowired private PaymentsService paymentsService; + @Autowired private PaymentPositionCRUDService paymentsService; @MockBean private PaymentPositionRepository paymentPositionRepository; @MockBean private PaymentOptionRepository paymentOptionRepository; @MockBean private TransferRepository transferRepository;