diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 87e8ffd3..9c4d4735 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -57,7 +57,7 @@ jobs: needs: [ integration_test ] runs-on: ubuntu-latest name: Notify - if: always() + if: ${{ always() && inputs.environment == 'uat' }} steps: - name: Report Status if: always() @@ -65,7 +65,7 @@ jobs: with: status: ${{ needs.integration_test.result }} token: ${{ secrets.GITHUB_TOKEN }} - notify_when: 'failure,skipped' + notify_when: 'failure' notification_title: '{workflow} has {status_message}' message_format: '{emoji} <{workflow_url}|{workflow}> {status_message} in <{repo_url}|{repo}>' footer: 'Linked to Repo <{repo_url}|{repo}>' diff --git a/helm/Chart.yaml b/helm/Chart.yaml index cb3a6d27..bafeaa37 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-gpd-core description: micro-service to manage Creditor Institution debtor positions type: application -version: 0.124.0 -appVersion: 0.11.27 +version: 0.125.0 +appVersion: 0.11.27-1-PAGOPA-1744-getDebtPositionByIUV dependencies: - name: microservice-chart version: 2.4.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index cd3c79a2..27f55854 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -5,7 +5,7 @@ microservice-chart: image: repository: ghcr.io/pagopa/pagopa-debt-position tag: "0.11.2-1-PAGOPA-1530-upsert" - tag: "0.11.27" + tag: "0.11.27-1-PAGOPA-1744-getDebtPositionByIUV" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 10a73a39..d8c15e51 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-debt-position - tag: "0.11.27" + tag: "0.11.27-1-PAGOPA-1744-getDebtPositionByIUV" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 9ac95ed9..635e126e 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-debt-position - tag: "0.11.27" + tag: "0.11.27-1-PAGOPA-1744-getDebtPositionByIUV" pullPolicy: Always livenessProbe: httpGet: diff --git a/integration-test/src/features/debt-position-manage.feature b/integration-test/src/features/debt-position-manage.feature index 87125d11..33fe2562 100644 --- a/integration-test/src/features/debt-position-manage.feature +++ b/integration-test/src/features/debt-position-manage.feature @@ -8,37 +8,32 @@ Feature: Managing a debt position When the debt position is created Then the debt position gets the status code 201 And the organization gets the nav value after creation - - Scenario: Debt position notification fee update + # Debt position notification fee update When the notification fee of the debt position is updated Then the organization gets the status code 209 And the organization gets the updated amounts - - Scenario: Debt position filter list by status and due date + # Debt position filter list by status and due date Given the filter made by status "DRAFT" And the filter made by due date from today to 10 days When we ask the list of organizations debt positions Then we get the status code 200 - - Scenario: Debt position filter list by payment date + # Debt position filter list by payment date Given the filter made by payment date from today to 20 days When we ask the list of organizations debt positions Then we get the status code 200 - - Scenario: Debt position update + # Debt position update When the debt position is updated Then the organization gets the update status code 200 And the organization gets the nav value after update - - Scenario: Debt position get + # Debt position get When we get the debt position Then the company name is "Testing S.p.A." And the organization get the nav value - - Scenario: Debt position deleted + # Debt position deleted When the debt position is deleted Then the debt position gets the status code 200 + Scenario: Debt position filter list: exclusive param violation Given the filter made by due date from today to 10 days And the filter made by payment date from today to 20 days diff --git a/integration-test/src/features/debt-position-pay.feature b/integration-test/src/features/debt-position-pay.feature index 7384dbf5..bb6cdf43 100644 --- a/integration-test/src/features/debt-position-pay.feature +++ b/integration-test/src/features/debt-position-pay.feature @@ -7,16 +7,13 @@ Feature: Paying a debt position Given a random iupd When the debt position is created Then the debt position gets the status code 201 - - Scenario: Debt position publication + # Debt position publication When the debt position is published Then the debt position gets the status code 200 And the organization gets the nav value after publication - - Scenario: Payment option payment + # Payment option payment When the payment option is paid Then the payment option gets the status code 200 - - Scenario: Reporting the transfer + # Reporting the transfer When the transfer is reported Then the transfer gets the status code 200 \ No newline at end of file diff --git a/integration-test/src/features/debt-position-retrieval.feature b/integration-test/src/features/debt-position-retrieval.feature new file mode 100644 index 00000000..d0311fd2 --- /dev/null +++ b/integration-test/src/features/debt-position-retrieval.feature @@ -0,0 +1,14 @@ +Feature: Retrieve a debt position + + Background: + Given GPD running + + Scenario: Get Debt Position by IUV + # Remove dirty data -> create Payment Positions -> Get Payment Position by IUV + Given the debt position with IUPD 77777777777_GET_PP_BY_IUV is deleted + Given the debt position with IUPD 77777777777_GET_PP_BY_IUV and payment option with IUV 99000000000000000 is created + Then the response returns the status code 201 + When we get the debt position by IUV 99000000000000000 + Then the response returns the status code 200 + And the debt position response IUV value is 99000000000000000 + And the debt position with IUPD 77777777777_GET_PP_BY_IUV is deleted diff --git a/integration-test/src/features/debt-position-update-and-publish.feature b/integration-test/src/features/debt-position-update-and-publish.feature index 0e758082..6a61c557 100644 --- a/integration-test/src/features/debt-position-update-and-publish.feature +++ b/integration-test/src/features/debt-position-update-and-publish.feature @@ -5,7 +5,7 @@ Feature: Managing a debt position Scenario: Debt position creation Given a random iupd - And a new debt position - When the debt position is updated and published + When the debt position is created + And the debt position is updated and published Then the debt position gets the status code 200 And the debt position gets status "VALID" \ No newline at end of file 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 6e86edf0..890293da 100644 --- a/integration-test/src/step_definitions/support/clients/gpd_client.js +++ b/integration-test/src/step_definitions/support/clients/gpd_client.js @@ -115,6 +115,18 @@ function getDebtPosition(orgId, iupd, segCodes) { }) } +function getDebtPositionByIUV(orgId, iuv, segCodes) { + const params = {} + if (segCodes) {params.segregationCodes = segCodes} + return get(GPD_HOST + `/organizations/${orgId}/paymentoptions/${iuv}/debtposition`, { + timeout: API_TIMEOUT, + headers: { + "Ocp-Apim-Subscription-Key": process.env.API_SUBSCRIPTION_KEY, + "Content-Type": "application/json" + } + }) +} + function getPaymentOptionByIuv(orgId, iuv) { return get(GPD_HOST + `/organizations/${orgId}/paymentoptions/${iuv}`, { timeout: API_TIMEOUT, @@ -202,6 +214,7 @@ module.exports = { updateNotificationFee, getDebtPositionList, getDebtPosition, + getDebtPositionByIUV, deleteDebtPosition, payPaymentOption, reportTransfer, diff --git a/integration-test/src/step_definitions/support/logic/common_logic.js b/integration-test/src/step_definitions/support/logic/common_logic.js index 59803b9a..9a6a1c50 100644 --- a/integration-test/src/step_definitions/support/logic/common_logic.js +++ b/integration-test/src/step_definitions/support/logic/common_logic.js @@ -49,6 +49,10 @@ async function assertNav(debtPosition, response) { assert.strictEqual(response.paymentOption[0].nav, auxDigit + debtPosition.paymentOption[0].iuv); } +async function assertIUV(response, expectedIUV) { + assert.strictEqual(response.paymentOption[0].iuv, expectedIUV); +} + async function assertSize (array, expectedSize){ assert.strictEqual(array.length, expectedSize) } @@ -77,6 +81,7 @@ module.exports = { randomIupd, assertIupd, assertNav, + assertIUV, assertNotificationFeeUpdatedDateNotificationFee, assertSize, assertMinSize diff --git a/integration-test/src/step_definitions/support/logic/gpd_logic.js b/integration-test/src/step_definitions/support/logic/gpd_logic.js index bc001245..f0089472 100644 --- a/integration-test/src/step_definitions/support/logic/gpd_logic.js +++ b/integration-test/src/step_definitions/support/logic/gpd_logic.js @@ -12,7 +12,8 @@ const { updateAndPublishDebtPosition, getPaymentOptionByIuv, invalidateDebtPosition, - createMassiveDebtPositions + createMassiveDebtPositions, + getDebtPositionByIUV } = require("../clients/gpd_client"); const { @@ -24,9 +25,9 @@ const { buildCreateMassiveDebtPositionRequest } = require("../utility/request_builders"); -async function executeDebtPositionCreation(bundle, idOrg, iupd) { +async function executeDebtPositionCreation(bundle, idOrg, iupd, iuv) { bundle.organizationCode = idOrg; - bundle.debtPosition = buildDebtPositionDynamicData(bundle, iupd); + bundle.debtPosition = buildDebtPositionDynamicData(bundle, iupd, iuv); let response = await createDebtPosition(bundle.organizationCode, buildCreateDebtPositionRequest(bundle.debtPosition, bundle.payer)); bundle.responseToCheck = response; bundle.createdDebtPosition = bundle.responseToCheck.data; @@ -124,6 +125,12 @@ async function executeDebtPositionGet(bundle, idOrg, iupd) { bundle.responseToCheck = response; } +async function executeDebtPositionGetByIuv(bundle, idOrg, iuv) { + let response = await getDebtPositionByIUV(idOrg, iuv); + bundle.payer.companyName = response.data.companyName; + bundle.responseToCheck = response; +} + async function executeDebtPositionGetWithSegregationCodes(bundle, idOrg, iupd) { let segCodes = bundle.debtPosition.iuv1.slice(0, 2) let response = await getDebtPosition(idOrg, iupd, segCodes); @@ -198,6 +205,7 @@ module.exports = { executeDebtPositionUpdate, executeDebtPositionNotificationFeeUpdate, executeDebtPositionGet, + executeDebtPositionGetByIuv, executeDebtPositionPublish, executePaymentOptionPay, executeReportTransfer, diff --git a/integration-test/src/step_definitions/support/steps.js b/integration-test/src/step_definitions/support/steps.js index 93a0e622..fc4df4e1 100644 --- a/integration-test/src/step_definitions/support/steps.js +++ b/integration-test/src/step_definitions/support/steps.js @@ -12,6 +12,7 @@ const { executeDebtPositionCreation, executeDebtPositionCreationAndPublication, executeDebtPositionUpdateAndPublication, executePaymentOptionGetByIuv, + executeDebtPositionGetByIuv, executeOKDebtPositionCreation, executeKODebtPositionCreation, executeDebtPositionNotificationFeeUpdateNodeOK, @@ -27,7 +28,9 @@ const { executeDebtPositionCreation, executeMassiveDebtPositionCreationWithSegregationCodes } = require('./logic/gpd_logic'); const { assertAmount, assertFaultCode, assertOutcome, assertStatusCode, assertCompanyName, assertNotificationFeeUpdatedAmounts, -assertStatusString, executeAfterAllStep, randomOrg, randomIupd, assertIupd, assertNav, assertNotificationFeeUpdatedDateNotificationFee, assertSize, assertMinSize } = require('./logic/common_logic'); +assertStatusString, executeAfterAllStep, randomOrg, randomIupd, assertIupd, assertNav, assertNotificationFeeUpdatedDateNotificationFee, assertSize, assertMinSize, + assertIUV +} = require('./logic/common_logic'); const { gpdSessionBundle, gpdUpdateBundle, gpdPayBundle } = require('./utility/data'); const { getValidBundle, addDays, format } = require('./utility/helpers'); @@ -56,7 +59,6 @@ BeforeAll(async function() { */ Given('GPD running', () => executeHealthCheckForGPD()); - /* * Debt position creation */ @@ -65,7 +67,8 @@ Given('a random iupd', async function () { // precondition -> deletion possible dirty data await executeDebtPositionDeletion(gpdSessionBundle, idOrg, iupd); }); -When('the debt position is created', () => executeDebtPositionCreation(gpdSessionBundle, idOrg, iupd, status)); +When(/^the debt position with IUPD (.*) and payment option with IUV (.*) is created$/, (IUPD_input, iuv) => executeDebtPositionCreation(gpdSessionBundle, idOrg, IUPD_input, iuv)); +When('the debt position is created', () => executeDebtPositionCreation(gpdSessionBundle, idOrg, iupd)); Then('the debt position gets the status code {int}', (statusCode) => assertStatusCode(gpdSessionBundle, statusCode)); Then('the organization gets the nav value after creation', () => assertNav(gpdSessionBundle.createdDebtPosition, gpdSessionBundle.responseToCheck.data)); @@ -73,7 +76,7 @@ Then('the organization gets the nav value after creation', () => assertNav(gpdSe * Massive debt positions creation */ -When('the debt position items is created', () => executeMassiveDebtPositionsCreation(gpdSessionBundle, idOrg, iupd, status)); +When('the debt position items is created', () => executeMassiveDebtPositionsCreation(gpdSessionBundle, idOrg, iupd)); /* @@ -128,14 +131,16 @@ Then('the organization gets the nav value after update', () => assertNav(gpdSess * Debt position get */ When('we get the debt position', () => executeDebtPositionGet(gpdSessionBundle, idOrg, iupd)); +When(/^we get the debt position by IUV (.*)$/, (iuv) => executeDebtPositionGetByIuv(gpdSessionBundle, idOrg, iuv)); Then('the company name is {string}', (companyName) => assertCompanyName(gpdSessionBundle, companyName)); Then('the organization get the nav value', () => assertNav(gpdSessionBundle.responseToCheck.data, gpdSessionBundle.responseToCheck.data)) +Then(/^the debt position response IUV value is (.*)$/, (expectedIUV) => assertIUV(gpdSessionBundle.responseToCheck.data, expectedIUV)) /* * Debt position delete */ When('the debt position is deleted', () => executeDebtPositionDeletion(gpdSessionBundle, idOrg, iupd)); - +Then(/^the debt position with IUPD (.*) is deleted$/, (IUPD_input) => executeDebtPositionDeletion(gpdSessionBundle, idOrg, IUPD_input)); /* * Debt position publish @@ -161,6 +166,7 @@ Then('the payment option gets the status code {int}', (statusCode) => assertStat */ When('we get the payment option by iuv', () => executePaymentOptionGetByIuv(gpdSessionBundle, idOrg, gpdSessionBundle.debtPosition.iuv1)); Then('the get payment options returns the status code {int}', (statusCode) => assertStatusCode(gpdSessionBundle, statusCode)); +Then('the response returns the status code {int}', (statusCode) => assertStatusCode(gpdSessionBundle, statusCode)); Then('the iupd is present and valued with the same value as the debt position', () => assertIupd(gpdSessionBundle)); /* @@ -175,14 +181,13 @@ Then('the transfer gets the status code {int}', (statusCode) => assertStatusCode When('the debt position is created and published', () => executeDebtPositionCreationAndPublication(gpdSessionBundle, idOrg, iupd)); Then('the debt position gets status {string}', (statusString) => assertStatusString(gpdSessionBundle, statusString)); -Given('a new debt position', () => executeDebtPositionCreation(gpdSessionBundle, idOrg, iupd, status)); When('the debt position is updated and published', () => executeDebtPositionUpdateAndPublication(gpdSessionBundle, idOrg, iupd)); /* * Debt position manage with segregation codes */ - When('the debt position using segregation codes is created', () => executeDebtPositionCreationWithSegregationCodes(gpdSessionBundle, idOrg, iupd, status)); + When('the debt position using segregation codes is created', () => executeDebtPositionCreationWithSegregationCodes(gpdSessionBundle, idOrg, iupd)); When('the debt position items, using segregation codes, is created', () => executeMassiveDebtPositionCreationWithSegregationCodes(gpdSessionBundle, idOrg, iupd, status)); When('the debt position using segregation codes is updated', () => executeDebtPositionUpdateWithSegregationCodes(gpdSessionBundle, gpdUpdateBundle, idOrg, iupd)); When('the organization gets the debt position using segregation codes', () => executeDebtPositionGetWithSegregationCodes(gpdSessionBundle, idOrg, iupd)); diff --git a/integration-test/src/step_definitions/support/utility/request_builders.js b/integration-test/src/step_definitions/support/utility/request_builders.js index d81685b7..459d7ea0 100644 --- a/integration-test/src/step_definitions/support/utility/request_builders.js +++ b/integration-test/src/step_definitions/support/utility/request_builders.js @@ -1,9 +1,9 @@ const { addDays, buildStringFromDate, makeidNumber, makeidMix, } = require("./helpers"); -function buildDebtPositionDynamicData(gpdSessionBundle, iupdIn) { +function buildDebtPositionDynamicData(gpdSessionBundle, iupdIn, iuv = makeidNumber(17)) { return { iupd: iupdIn, - iuv1: makeidNumber(17), + iuv1: iuv, iuv2: makeidNumber(17), iuv3: makeidNumber(17), iuvOK: process.env.iuv_ok, // es. "11101751670642134" diff --git a/openapi/openapi_external.json b/openapi/openapi_external.json index 75baf927..e551dd93 100644 --- a/openapi/openapi_external.json +++ b/openapi/openapi_external.json @@ -4,7 +4,7 @@ "title": "PagoPA API Debt Position", "description": "Progetto Gestione Posizioni Debitorie", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.11.27" + "version": "0.11.27-1-PAGOPA-1744-getDebtPositionByIUV" }, "servers": [ { diff --git a/openapi/openapi_external_massive.json b/openapi/openapi_external_massive.json index 2b855b20..6819f189 100644 --- a/openapi/openapi_external_massive.json +++ b/openapi/openapi_external_massive.json @@ -4,7 +4,7 @@ "title": "PagoPA API Debt Position", "description": "Progetto Gestione Posizioni Debitorie", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.11.27" + "version": "0.11.27-1-PAGOPA-1744-getDebtPositionByIUV" }, "servers": [ { diff --git a/openapi/openapi_internal.json b/openapi/openapi_internal.json index a1d7e5f0..9b4e211b 100644 --- a/openapi/openapi_internal.json +++ b/openapi/openapi_internal.json @@ -1,3110 +1,2958 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Debt Position", - "description": "Progetto Gestione Posizioni Debitorie", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.11.27" + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Debt Position", + "description" : "Progetto Gestione Posizioni Debitorie", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "0.11.27-1-PAGOPA-1744-getDebtPositionByIUV" }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Debt Positions API" - }, - { - "name": "Debt Position Actions API" - }, - { - "name": "Payments API" - } - ], - "paths": { - "/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" + "servers" : [ { + "url" : "http://localhost", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Debt Positions API" + }, { + "name" : "Debt Position Actions API" + }, { + "name" : "Payments API" + } ], + "paths" : { + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "403" : { + "description" : "Forbidden.", + "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" } } } }, - "401": { - "description": "Wrong or missing function key.", - "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" } } - } - }, - "403": { - "description": "Forbidden.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } } }, - "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" } } } } }, - "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}/debtpositions": { - "get": { - "tags": [ - "Debt Positions API" - ], - "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": 100, - "type": "integer", - "format": "int32", - "default": 50 - } - }, - { - "name": "page", - "in": "query", - "description": "Page number. Page value starts from 0", - "required": true, - "schema": { - "minimum": 0, - "type": "integer", - "format": "int32" - } - }, - { - "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", - "INVALID", - "EXPIRED", - "PARTIALLY_PAID", - "PAID", - "REPORTED" - ] - } - }, - { - "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" + "/organizations/{organizationfiscalcode}/debtpositions" : { + "get" : { + "tags" : [ "Debt Positions API" ], + "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" : true, + "schema" : { + "minimum" : 0, + "type" : "integer", + "format" : "int32" + } + }, { + "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", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED" ] + } + }, { + "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" : { + "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/PaymentPositionsInfo" } } } }, - "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" } } - } - }, - "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" + } + }, + "429" : { + "description" : "Too many requests.", + "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" + "400" : { + "description" : "Malformed request.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionsInfo" + "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" } } } } }, - "security": [ - { - "ApiKey": [] - }, - { - "Authorization": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + }, { + "Authorization" : [ ] + } ] }, - "put": { - "tags": [ - "Debt Positions API" - ], - "summary": "The Organization updates multiple debt positions.", - "operationId": "updateMultiplePositions", - "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 - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MultiplePaymentPositionModel" - } - } - }, - "required": true + "put" : { + "tags" : [ "Debt Positions API" ], + "summary" : "The Organization updates multiple debt positions.", + "operationId" : "updateMultiplePositions", + "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 + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/MultiplePaymentPositionModel" + } + } + }, + "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" } } } }, - "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" + } + }, + "200" : { + "description" : "Debt Positions 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" + "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" } } } }, - "200": { - "description": "Debt Positions updated.", - "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" } } } } }, - "security": [ - { - "ApiKey": [] - }, - { - "Authorization": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + }, { + "Authorization" : [ ] + } ] }, - "post": { - "tags": [ - "Debt Positions API" - ], - "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 - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" - } - } - }, - "required": true + "post" : { + "tags" : [ "Debt Positions API" ], + "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 + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModel" + } + } + }, + "required" : true }, - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "responses" : { + "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/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" + "201" : { + "description" : "Request created.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModel" } } } }, - "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" } } } }, - "201": { - "description": "Request created.", - "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/PaymentPositionModel" + "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" - } - } - }, - "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": [] - }, - { - "Authorization": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + }, { + "Authorization" : [ ] + } ] }, - "delete": { - "tags": [ - "Debt Positions API" - ], - "summary": "The Organization deletes multiple debt positions.", - "operationId": "deleteMultipleDebtPositions", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "pattern": "\\b\\w{11}\\b", - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MultipleIUPDModel" - } - } - }, - "required": true + "delete" : { + "tags" : [ "Debt Positions API" ], + "summary" : "The Organization deletes multiple debt positions.", + "operationId" : "deleteMultipleDebtPositions", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "pattern" : "\\b\\w{11}\\b", + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/MultipleIUPDModel" + } + } + }, + "required" : true }, - "responses": { - "401": { - "description": "Wrong or missing function key.", - "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" : { } } }, - "409": { - "description": "Payment Position not found.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Debt Positions deleted.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": {} + "content" : { + "application/json" : { + "schema" : { + "type" : "string" + } + } } }, - "500": { - "description": "Service unavailable.", - "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": {} + "content" : { + "application/json" : { } } }, - "200": { - "description": "Debt Positions updated.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Payment Position not found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "type": "string" - } - } + "content" : { + "application/json" : { } } }, - "400": { - "description": "Malformed request.", - "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" } } - }, - "content": { - "application/json": {} } } }, - "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}/debtpositions/bulk": { - "post": { - "tags": [ - "Debt Positions API" - ], - "summary": "The Organization creates multiple debt positions.", - "operationId": "createMultiplePositions", - "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 - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MultiplePaymentPositionModel" - } - } - }, - "required": true + "/organizations/{organizationfiscalcode}/debtpositions/bulk" : { + "post" : { + "tags" : [ "Debt Positions API" ], + "summary" : "The Organization creates multiple debt positions.", + "operationId" : "createMultiplePositions", + "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 + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/MultiplePaymentPositionModel" + } + } + }, + "required" : true }, - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "responses" : { + "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/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" + "201" : { + "description" : "Request created.", + "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" + "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" } } } }, - "201": { - "description": "Request created.", - "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" } } - } - }, - "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/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": [] - }, - { - "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}/debtpositions/{iupd}": { - "get": { - "tags": [ - "Debt Positions API" - ], - "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" + "/organizations/{organizationfiscalcode}/debtpositions/{iupd}" : { + "get" : { + "tags" : [ "Debt Positions API" ], + "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" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Obtained debt position details.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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/PaymentPositionModelBaseResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModelBaseResponse" } } } }, - "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": [] - }, - { - "Authorization": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + }, { + "Authorization" : [ ] + } ] }, - "put": { - "tags": [ - "Debt Positions API" - ], - "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 - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" - } - } - }, - "required": true + "put" : { + "tags" : [ "Debt Positions API" ], + "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 + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModel" + } + } + }, + "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" } } } }, - "401": { - "description": "Wrong or missing function key.", - "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/PaymentPositionModel" } } } }, - "409": { - "description": "Conflict: existing related payment found.", - "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" } } } }, - "400": { - "description": "Malformed request.", - "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" } } } }, - "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/PaymentPositionModel" + "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": [] - }, - { - "Authorization": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + }, { + "Authorization" : [ ] + } ] }, - "delete": { - "tags": [ - "Debt Positions API" - ], - "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" + "delete" : { + "tags" : [ "Debt Positions API" ], + "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" } } }, - "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" + "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" + "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" } } } }, - "409": { - "description": "Conflict: existing related payment found.", - "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" } } } }, - "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" + "401" : { + "description" : "Wrong or missing function key.", + "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" } - ] + } ] }, - "/organizations/{organizationfiscalcode}/debtpositions/{iupd}/invalidate": { - "post": { - "tags": [ - "Debt Position Actions API" - ], - "summary": "The Organization invalidate a debt Position.", - "operationId": "invalidatePosition", - "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" - } - } - ], - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/organizations/{organizationfiscalcode}/debtpositions/{iupd}/invalidate" : { + "post" : { + "tags" : [ "Debt Position Actions API" ], + "summary" : "The Organization invalidate a debt Position.", + "operationId" : "invalidatePosition", + "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" + } + } ], + "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" } } } }, - "401": { - "description": "Wrong or missing function key.", - "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/PaymentPositionModel" } } } }, - "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 invalidable 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" } } } }, - "200": { - "description": "Request published.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "409": { - "description": "Conflict: debt position is not in invalidable state.", - "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": [] - }, - { - "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}/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" - } - } - ], - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/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" + } + } ], + "responses" : { + "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" } } } }, - "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" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "No debt position found.", - "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/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentPositionModel" } } } }, - "200": { - "description": "Request published.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentPositionModel" + "401" : { + "description" : "Wrong or missing function key.", + "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" + "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": [] - }, - { - "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/{iuv}/transfers/{transferid}/report": { - "post": { - "tags": [ - "Payments API" - ], - "summary": "The organization reports a transaction.", - "operationId": "reportTransfer", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "Organization fiscal code, the fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iuv", - "in": "path", - "description": "IUV (Unique Payment Identification). Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "transferid", - "in": "path", - "description": "Transaction identifier. Alphanumeric code that identifies the specific transaction", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/organizations/{organizationfiscalcode}/paymentoptions/{iuv}/debtposition" : { + "get" : { + "tags" : [ "Debt Positions API" ], + "summary" : "The organization retrieves a debt position by payment option IUV", + "operationId" : "getDebtPositionByIUV", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "pattern" : "\\d{11}", + "type" : "string" + } + }, { + "name" : "iuv", + "in" : "path", + "description" : "Payment Option IUV", + "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" + } + } + }, + "content" : { + "application/json" : { } + } + }, + "400" : { + "description" : "Malformed request.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { } + } + }, + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } + }, + "404" : { + "description" : "Payment Position not found.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { } + } + }, + "200" : { + "description" : "Debt Positions 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/PaymentPositionModelBaseResponse" } } } }, - "200": { - "description": "Request reported.", - "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" + } + } + } + } + }, + "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" + } + } ] + }, + "/organizations/{organizationfiscalcode}/paymentoptions/{iuv}/transfers/{transferid}/report" : { + "post" : { + "tags" : [ "Payments API" ], + "summary" : "The organization reports a transaction.", + "operationId" : "reportTransfer", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "Organization fiscal code, the fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iuv", + "in" : "path", + "description" : "IUV (Unique Payment Identification). Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "transferid", + "in" : "path", + "description" : "Transaction identifier. Alphanumeric code that identifies the specific transaction", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Request reported.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentsTransferModelResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentsTransferModelResponse" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "No transfer 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" + "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" } } } }, - "404": { - "description": "No transfer found.", - "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" } } } }, - "400": { - "description": "Malformed request.", - "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": [] }, - { - "Authorization": [] + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } } - ] + }, + "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": { - "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" - } - } - ], - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "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" : { + "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" + } + } ], + "responses" : { + "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" } } } }, - "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" } } - } - }, - "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" + } + }, + "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" + "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" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "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}/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" - } - } - }, - "required": true + "/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" + } + } + }, + "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" } } } }, - "401": { - "description": "Wrong or missing function key.", - "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" } } } }, - "400": { - "description": "Malformed request.", - "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" } } } }, - "200": { - "description": "Request updated.", - "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/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" + "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" } } } }, - "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" + "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" + "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" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "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}/pay": { - "post": { - "tags": [ - "Payments API" - ], - "summary": "The Organization paid a payment option.", - "operationId": "payPaymentOption", - "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/PayPaymentOptionModel" - } - } - }, - "required": true + "/organizations/{organizationfiscalcode}/paymentoptions/{nav}/pay" : { + "post" : { + "tags" : [ "Payments API" ], + "summary" : "The Organization paid a payment option.", + "operationId" : "payPaymentOption", + "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/PayPaymentOptionModel" + } + } + }, + "required" : true }, - "responses": { - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "responses" : { + "422" : { + "description" : "Unprocessable: not in payable 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" } } } }, - "401": { - "description": "Wrong or missing function key.", - "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" } } } }, - "409": { - "description": "Conflict: existing related payment found.", - "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" } } } }, - "400": { - "description": "Malformed request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Request paid.", + "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" } } } }, - "200": { - "description": "Request paid.", - "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" } } } }, - "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" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "422": { - "description": "Unprocessable: not in payable state.", - "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" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "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" + "PaymentOptionMetadataModelResponse" : { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" }, - "value": { - "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/PaymentsTransferModelResponse" + "transfer" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentsTransferModelResponse" } } } }, - "PaymentsTransferModelResponse": { - "type": "object", - "properties": { - "organizationFiscalCode": { - "type": "string" + "PaymentsTransferModelResponse" : { + "type" : "object", + "properties" : { + "organizationFiscalCode" : { + "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" } } } }, - "Stamp": { - "required": [ - "hashDocument", - "provincialResidence", - "stampType" - ], - "type": "object", - "properties": { - "hashDocument": { - "type": "string", - "description": "Document hash" - }, - "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" : { + "type" : "string", + "description" : "Document hash" + }, + "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" + "TransferMetadataModelResponse" : { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" }, - "value": { - "type": "string" + "value" : { + "type" : "string" } } }, - "MultiplePaymentPositionModel": { - "required": [ - "paymentPositions" - ], - "type": "object", - "properties": { - "paymentPositions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentPositionModel" + "MultiplePaymentPositionModel" : { + "required" : [ "paymentPositions" ], + "type" : "object", + "properties" : { + "paymentPositions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentPositionModel" } } } }, - "PaymentOptionMetadataModel": { - "required": [ - "key" - ], - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "PaymentOptionMetadataModel" : { + "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" }, - "PaymentOptionModel": { - "required": [ - "amount", - "description", - "dueDate", - "isPartialPayment", - "iuv" - ], - "type": "object", - "properties": { - "nav": { - "type": "string" - }, - "iuv": { - "type": "string" - }, - "amount": { - "type": "integer", - "format": "int64" - }, - "description": { - "maxLength": 140, - "minLength": 0, - "type": "string" - }, - "isPartialPayment": { - "type": "boolean" - }, - "dueDate": { - "type": "string", - "format": "date-time" - }, - "retentionDate": { - "type": "string", - "format": "date-time" - }, - "fee": { - "type": "integer", - "format": "int64" - }, - "notificationFee": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "transfer": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferModel" - } - }, - "paymentOptionMetadata": { - "maxItems": 10, - "minItems": 0, - "type": "array", - "description": "it can added a maximum of 10 key-value pairs for metadata", - "items": { - "$ref": "#/components/schemas/PaymentOptionMetadataModel" + "PaymentOptionModel" : { + "required" : [ "amount", "description", "dueDate", "isPartialPayment", "iuv" ], + "type" : "object", + "properties" : { + "nav" : { + "type" : "string" + }, + "iuv" : { + "type" : "string" + }, + "amount" : { + "type" : "integer", + "format" : "int64" + }, + "description" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string" + }, + "isPartialPayment" : { + "type" : "boolean" + }, + "dueDate" : { + "type" : "string", + "format" : "date-time" + }, + "retentionDate" : { + "type" : "string", + "format" : "date-time" + }, + "fee" : { + "type" : "integer", + "format" : "int64" + }, + "notificationFee" : { + "type" : "integer", + "format" : "int64", + "readOnly" : true + }, + "transfer" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferModel" + } + }, + "paymentOptionMetadata" : { + "maxItems" : 10, + "minItems" : 0, + "type" : "array", + "description" : "it can added a maximum of 10 key-value pairs for metadata", + "items" : { + "$ref" : "#/components/schemas/PaymentOptionMetadataModel" } } } }, - "PaymentPositionModel": { - "required": [ - "companyName", - "fiscalCode", - "fullName", - "iupd", - "switchToExpired", - "type" - ], - "type": "object", - "properties": { - "iupd": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "F", - "G" - ] - }, - "payStandIn": { - "type": "boolean", - "description": "feature flag to enable a debt position in stand-in mode", - "example": true, - "default": true - }, - "pull": { - "type": "boolean", - "description": "feature flag to enable the debt position retrieval in pull mode", - "example": true, - "default": true - }, - "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" - }, - "switchToExpired": { - "type": "boolean", - "description": "feature flag to enable the debt position to expire after the due date", - "example": false, - "default": false - }, - "companyName": { - "maxLength": 140, - "minLength": 0, - "type": "string" - }, - "officeName": { - "maxLength": 140, - "minLength": 0, - "type": "string" - }, - "validityDate": { - "type": "string", - "format": "date-time" - }, - "paymentDate": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "status": { - "type": "string", - "readOnly": true, - "enum": [ - "DRAFT", - "PUBLISHED", - "VALID", - "INVALID", - "EXPIRED", - "PARTIALLY_PAID", - "PAID", - "REPORTED" - ] - }, - "paymentOption": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentOptionModel" + "PaymentPositionModel" : { + "required" : [ "companyName", "fiscalCode", "fullName", "iupd", "switchToExpired", "type" ], + "type" : "object", + "properties" : { + "iupd" : { + "type" : "string" + }, + "type" : { + "type" : "string", + "enum" : [ "F", "G" ] + }, + "payStandIn" : { + "type" : "boolean", + "description" : "feature flag to enable a debt position in stand-in mode", + "example" : true, + "default" : true + }, + "pull" : { + "type" : "boolean", + "description" : "feature flag to enable the debt position retrieval in pull mode", + "example" : true, + "default" : true + }, + "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" + }, + "switchToExpired" : { + "type" : "boolean", + "description" : "feature flag to enable the debt position to expire after the due date", + "example" : false, + "default" : false + }, + "companyName" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string" + }, + "officeName" : { + "maxLength" : 140, + "minLength" : 0, + "type" : "string" + }, + "validityDate" : { + "type" : "string", + "format" : "date-time" + }, + "paymentDate" : { + "type" : "string", + "format" : "date-time", + "readOnly" : true + }, + "status" : { + "type" : "string", + "readOnly" : true, + "enum" : [ "DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED" ] + }, + "paymentOption" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentOptionModel" } } } }, - "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": { - "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" - }, - "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" : { + "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" + }, + "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" } } } }, - "PayPaymentOptionModel": { - "required": [ - "idReceipt", - "pspCompany" - ], - "type": "object", - "properties": { - "paymentDate": { - "type": "string", - "format": "date-time" + "PayPaymentOptionModel" : { + "required" : [ "idReceipt", "pspCompany" ], + "type" : "object", + "properties" : { + "paymentDate" : { + "type" : "string", + "format" : "date-time" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "pspCompany": { - "type": "string" + "pspCompany" : { + "type" : "string" }, - "idReceipt": { - "type": "string" + "idReceipt" : { + "type" : "string" }, - "fee": { - "type": "string" + "fee" : { + "type" : "string" } } }, - "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/PaymentsTransferModelResponse" + "transfer" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentsTransferModelResponse" } } } }, - "PageInfo": { - "required": [ - "items_found", - "limit", - "page", - "total_pages" - ], - "type": "object", - "properties": { - "page": { - "type": "integer", - "description": "Page number", - "format": "int32" - }, - "limit": { - "type": "integer", - "description": "Required number of items per page", - "format": "int32" - }, - "items_found": { - "type": "integer", - "description": "Number of items found. (The last page may have fewer elements than required)", - "format": "int32" - }, - "total_pages": { - "type": "integer", - "description": "Total number of pages", - "format": "int32" - } - } - }, - "PaymentOptionModelResponse": { - "type": "object", - "properties": { - "nav": { - "type": "string" + "PaymentOptionModelResponse" : { + "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" }, - "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" } } } }, - "PaymentPositionModelBaseResponse": { - "type": "object", - "properties": { - "iupd": { - "type": "string" - }, - "organizationFiscalCode": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "F", - "G" - ] - }, - "pull": { - "type": "boolean" - }, - "companyName": { - "type": "string" - }, - "officeName": { - "type": "string" - }, - "insertedDate": { - "type": "string", - "format": "date-time" - }, - "publishDate": { - "type": "string", - "format": "date-time" - }, - "validityDate": { - "type": "string", - "format": "date-time" - }, - "paymentDate": { - "type": "string", - "format": "date-time" - }, - "status": { - "type": "string", - "enum": [ - "DRAFT", - "PUBLISHED", - "VALID", - "INVALID", - "EXPIRED", - "PARTIALLY_PAID", - "PAID", - "REPORTED" - ] - }, - "lastUpdatedDate": { - "type": "string", - "format": "date-time" - }, - "paymentOption": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentOptionModelResponse" + "PaymentPositionModelBaseResponse" : { + "type" : "object", + "properties" : { + "iupd" : { + "type" : "string" + }, + "organizationFiscalCode" : { + "type" : "string" + }, + "type" : { + "type" : "string", + "enum" : [ "F", "G" ] + }, + "pull" : { + "type" : "boolean" + }, + "companyName" : { + "type" : "string" + }, + "officeName" : { + "type" : "string" + }, + "insertedDate" : { + "type" : "string", + "format" : "date-time" + }, + "publishDate" : { + "type" : "string", + "format" : "date-time" + }, + "validityDate" : { + "type" : "string", + "format" : "date-time" + }, + "paymentDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "enum" : [ "DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED" ] + }, + "lastUpdatedDate" : { + "type" : "string", + "format" : "date-time" + }, + "paymentOption" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentOptionModelResponse" } } } }, - "PaymentPositionsInfo": { - "required": [ - "page_info", - "payment_position_list" - ], - "type": "object", - "properties": { - "payment_position_list": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentPositionModelBaseResponse" - } - }, - "page_info": { - "$ref": "#/components/schemas/PageInfo" - } - } - }, - "TransferModelResponse": { - "type": "object", - "properties": { - "organizationFiscalCode": { - "type": "string" + "TransferModelResponse" : { + "type" : "object", + "properties" : { + "organizationFiscalCode" : { + "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" } } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "PageInfo" : { + "required" : [ "items_found", "limit", "page", "total_pages" ], + "type" : "object", + "properties" : { + "page" : { + "type" : "integer", + "description" : "Page number", + "format" : "int32" + }, + "limit" : { + "type" : "integer", + "description" : "Required number of items per page", + "format" : "int32" + }, + "items_found" : { + "type" : "integer", + "description" : "Number of items found. (The last page may have fewer elements than required)", + "format" : "int32" + }, + "total_pages" : { + "type" : "integer", + "description" : "Total number of pages", + "format" : "int32" + } + } + }, + "PaymentPositionsInfo" : { + "required" : [ "page_info", "payment_position_list" ], + "type" : "object", + "properties" : { + "payment_position_list" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentPositionModelBaseResponse" + } + }, + "page_info" : { + "$ref" : "#/components/schemas/PageInfo" + } + } + }, + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } }, - "MultipleIUPDModel": { - "required": [ - "paymentPositionIUPDs" - ], - "type": "object", - "properties": { - "paymentPositionIUPDs": { - "maxItems": 100, - "minItems": 0, - "type": "array", - "items": { - "type": "string" + "MultipleIUPDModel" : { + "required" : [ "paymentPositionIUPDs" ], + "type" : "object", + "properties" : { + "paymentPositionIUPDs" : { + "maxItems" : 100, + "minItems" : 0, + "type" : "array", + "items" : { + "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/openapi/openapi_send.json b/openapi/openapi_send.json index 20339e30..0c51b23c 100644 --- a/openapi/openapi_send.json +++ b/openapi/openapi_send.json @@ -4,7 +4,7 @@ "title": "PagoPA API Debt Position", "description": "Progetto Gestione Posizioni Debitorie", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.11.27" + "version": "0.11.27-1-PAGOPA-1744-getDebtPositionByIUV" }, "servers": [ { diff --git a/pom.xml b/pom.xml index ba94dda6..beede76f 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ it.gov.pagopa.debtposition gpd - 0.11.27 + 0.11.27-1-PAGOPA-1744-getDebtPositionByIUV Gestione Posizioni Debitorie Progetto Gestione Posizioni Debitorie diff --git a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/IDebtPositionController.java b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/IDebtPositionController.java index 743e0487..d35d0c6a 100644 --- a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/IDebtPositionController.java +++ b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/IDebtPositionController.java @@ -175,10 +175,10 @@ ResponseEntity updateMultipleDebtPositions( @Operation(summary = "The Organization deletes multiple debt positions.", security = {@SecurityRequirement(name = "ApiKey"), @SecurityRequirement(name = "Authorization")}, operationId = "deleteMultipleDebtPositions") @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Debt Positions updated."), + @ApiResponse(responseCode = "200", description = "Debt Positions deleted."), @ApiResponse(responseCode = "400", description = "Malformed request.", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)), @ApiResponse(responseCode = "401", description = "Wrong or missing function key.", content = @Content(schema = @Schema())), - @ApiResponse(responseCode = "409", description = "Payment Position not found.", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)), + @ApiResponse(responseCode = "404", description = "Payment Position not found.", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)), @ApiResponse(responseCode = "500", description = "Service unavailable.", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))}) @DeleteMapping(value = "/organizations/{organizationfiscalcode}/debtpositions", produces = MediaType.APPLICATION_JSON_VALUE, @@ -189,4 +189,22 @@ ResponseEntity deleteMultipleDebtPositions( @Valid @RequestBody MultipleIUPDModel multipleIUPDModel, @Valid @Parameter(description = "Segregation codes for which broker is authorized", hidden = true) @Pattern(regexp = "\\d{2}(,\\d{2})*") @RequestParam(required = false) String segregationCodes); + + @Operation(summary = "The organization retrieves a debt position by payment option IUV", security = {@SecurityRequirement(name = "ApiKey"), @SecurityRequirement(name = "Authorization")}, operationId = "getDebtPositionByIUV") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Debt Positions updated."), + @ApiResponse(responseCode = "400", description = "Malformed request.", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)), + @ApiResponse(responseCode = "401", description = "Wrong or missing function key.", content = @Content(schema = @Schema())), + @ApiResponse(responseCode = "404", description = "Payment Position not found.", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE)), + @ApiResponse(responseCode = "429", description = "Too many requests.", content = @Content(schema = @Schema())), + @ApiResponse(responseCode = "500", description = "Service unavailable.", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))}) + @GetMapping(value = "/organizations/{organizationfiscalcode}/paymentoptions/{iuv}/debtposition", + produces = {"application/json"}) + ResponseEntity getDebtPositionByIUV( + @Parameter(description = "Organization fiscal code, the fiscal code of the Organization.", required = true) + @Pattern(regexp = "\\d{11}") @PathVariable("organizationfiscalcode") String organizationFiscalCode, + @Pattern(regexp = "^\\d{1,30}$") @Parameter(description = "Payment Option IUV", required = true) + @PathVariable("iuv") String iuv, + @Valid @Parameter(description = "Segregation codes for which broker is authorized", hidden = true) @Pattern(regexp = "\\d{2}(,\\d{2})*") + @RequestParam(required = false) String segregationCodes); } diff --git a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/impl/DebtPositionController.java b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/impl/DebtPositionController.java index 71188f46..5887faa5 100644 --- a/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/impl/DebtPositionController.java +++ b/src/main/java/it/gov/pagopa/debtposition/controller/pd/crud/api/impl/DebtPositionController.java @@ -175,7 +175,7 @@ public ResponseEntity createMultipleDebtPositions(String organizationFisca @Valid MultiplePaymentPositionModel multiplePaymentPositionModel, boolean toPublish, @Valid @Pattern(regexp = "\\d{2}(,\\d{2})*") String segregationCodes) { log.info(String.format(LOG_BASE_HEADER_INFO, "POST", "createMultipleDebtPositions", String.format(LOG_BASE_PARAMS_DETAIL, organizationFiscalCode, "N/A"))); - + // flip model to entity List debtPositions = multiplePaymentPositionModel.getPaymentPositions() .stream().map( dp -> modelMapper.map(dp, PaymentPosition.class)) @@ -183,7 +183,7 @@ public ResponseEntity createMultipleDebtPositions(String organizationFisca ArrayList segCodes = segregationCodes != null ? new ArrayList<>(Arrays.asList(segregationCodes.split(","))) : null; List createdDebtPosList = paymentPositionService.createMultipleDebtPositions(debtPositions, organizationFiscalCode, toPublish, segCodes); - + if (!CollectionUtils.isEmpty(createdDebtPosList)) { return ResponseEntity.status(HttpStatus.CREATED).build(); } @@ -223,4 +223,20 @@ public ResponseEntity deleteMultipleDebtPositions( return new ResponseEntity<>(Constants.DEBT_POSITION_DELETED, HttpStatus.OK); } + + @Override + public ResponseEntity getDebtPositionByIUV( + @Pattern(regexp = "\\d{11}") String organizationFiscalCode, + @Pattern(regexp = "^\\d{1,30}$") String iuv, + @Valid @Pattern(regexp = "\\d{2}(,\\d{2})*") String segregationCodes) { + log.info(String.format(LOG_BASE_HEADER_INFO, "GET", "getDebtPositionByIUV", String.format(LOG_BASE_PARAMS_DETAIL, organizationFiscalCode, iuv))); + + ArrayList segCodes = segregationCodes != null ? new ArrayList<>(Arrays.asList(segregationCodes.split(","))) : null; + // flip entity to model + PaymentPositionModelBaseResponse paymentPositionResponse = ObjectMapperUtils.map( + paymentPositionService.getDebtPositionByIUV(organizationFiscalCode, iuv, segCodes), + PaymentPositionModelBaseResponse.class); + + return new ResponseEntity<>(paymentPositionResponse, HttpStatus.OK); + } } diff --git a/src/main/java/it/gov/pagopa/debtposition/exception/AppError.java b/src/main/java/it/gov/pagopa/debtposition/exception/AppError.java index 23dacced..5f203343 100644 --- a/src/main/java/it/gov/pagopa/debtposition/exception/AppError.java +++ b/src/main/java/it/gov/pagopa/debtposition/exception/AppError.java @@ -26,6 +26,7 @@ public enum AppError { DEBT_POSITION_FORBIDDEN(HttpStatus.FORBIDDEN, "The payment position is forbidden", "The caller does not have proper authorization to access or modify the IUVs in the payment position. [Organization Fiscal Code=%s, IUPD=%s]"), ORGANIZATION_NOT_FOUND(HttpStatus.NOT_FOUND, "Not found the organization", "Not found an organization for the Organization Fiscal Code %s"), PAYMENT_OPTION_NOT_FOUND(HttpStatus.NOT_FOUND, "Not found the payment option", "Not found a payment option for Organization Fiscal Code %s and NAV %s"), + PAYMENT_OPTION_IUV_NOT_FOUND(HttpStatus.NOT_FOUND, "Not found the payment option", "Not found a payment option for Organization Fiscal Code %s and IUV %s"), PAYMENT_OPTION_NOT_PAYABLE(HttpStatus.UNPROCESSABLE_ENTITY, "Not in payable state", "The payment option with Organization Fiscal Code %s and NAV %s is not in payable state"), PAYMENT_OPTION_ALREADY_PAID(HttpStatus.CONFLICT, "Existing related payment found", "A payment transaction has already been carried out for the Organization Fiscal Code %s and NAV %s"), PAYMENT_OPTION_NOTIFICATION_FEE_UPDATE_FAILED(HttpStatus.INTERNAL_SERVER_ERROR, "The update of the notification fee for the payment option is failed", "Notification fee update failed for the payment option with Organization Fiscal Code %s and IUV %s"), 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 29e41f6a..262072ae 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 @@ -108,6 +108,21 @@ public PaymentPosition getDebtPositionByIUPD(String organizationFiscalCode, return pp.get(); } + public PaymentPosition getDebtPositionByIUV(String organizationFiscalCode, + String iuv, List segCodes) { + if(segCodes != null && !isAuthorizedBySegregationCode(iuv, segCodes)) { + throw new AppException(AppError.DEBT_POSITION_FORBIDDEN, organizationFiscalCode, iuv); + } + + Optional po = paymentOptionRepository.findByOrganizationFiscalCodeAndIuv(organizationFiscalCode, iuv); + + if (po.isEmpty()) { + throw new AppException(AppError.PAYMENT_OPTION_IUV_NOT_FOUND, organizationFiscalCode, iuv); + } + + return po.get().getPaymentPosition(); + } + public List getDebtPositionsByIUPDs(String organizationFiscalCode, List iupdList, List segCodes) { // findAll query by IUPD list PaymentPositionByIUPDList spec = new PaymentPositionByIUPDList(iupdList); @@ -411,5 +426,9 @@ private boolean isAuthorizedBySegregationCode(PaymentPosition paymentPosition, L return segregationCodes.contains(paymentPositionSegregationCode); } - + private boolean isAuthorizedBySegregationCode(String iuv, List segregationCodes) { + // It is enough to check only one IUV of the payment position. Here it is assumed that they all have the same segregation code. + String paymentPositionSegregationCode = iuv.substring(0,2); + return segregationCodes.contains(paymentPositionSegregationCode); + } } diff --git a/src/main/resources/logback-local.xml b/src/main/resources/logback-local.xml new file mode 100644 index 00000000..57320881 --- /dev/null +++ b/src/main/resources/logback-local.xml @@ -0,0 +1,17 @@ + + + + + + + + + %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %clr(%mdc){magenta} %m%n%wEx + + + + + + + + \ No newline at end of file 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 39f98f8a..02537fb4 100644 --- a/src/test/java/it/gov/pagopa/debtposition/controller/DebtPositionControllerTest.java +++ b/src/test/java/it/gov/pagopa/debtposition/controller/DebtPositionControllerTest.java @@ -305,6 +305,113 @@ void createDebtPositionWithMetadata_400() throws Exception { .andExpect(content().string(containsString("size must be between 0 and 10"))); } + /** + * GET DEBT POSITION BY IUV + */ + @Test + void getDebtPositionByIUV_200() throws Exception { + PaymentPositionDTO pp = DebtPositionMock.getMock1(); + String iuv = "47999999999999999"; + pp.getPaymentOption().get(0).setIuv(iuv); + mvc.perform(post("/organizations/20077777771/debtpositions") + .content(TestUtil.toJson(pp)).contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isCreated()); + + String url = "/organizations/20077777771/paymentoptions/" + iuv + "/debtposition"; + mvc.perform(get(url).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].nav") + .value(auxDigit+iuv)); + } + + @Test + void getDebtPositionByIUV_WithMetadata_200() throws Exception { + // Creo una posizione debitoria con metadati su PO e transfer, la recupero e verifico siano presenti i metadati inseriti + PaymentPositionDTO pp = DebtPositionMock.getMetadataMock8(); + String iuv = "47999999999999999"; + pp.getPaymentOption().get(0).setIuv(iuv); + mvc.perform(post("/organizations/20077777772/debtpositions") + .content(TestUtil.toJson(pp)).contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isCreated()).andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].nav").value(auxDigit+iuv)) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].paymentOptionMetadata").isArray()) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].paymentOptionMetadata[0].key") + .value("keypometadatamock9")) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].transfer[0].transferMetadata[0].key") + .value("keytransfermetadatamock3")); + + String url = "/organizations/20077777772/paymentoptions/" + iuv + "/debtposition"; + mvc.perform(get(url).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].nav").value(auxDigit+iuv)) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].paymentOptionMetadata").isArray()) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].paymentOptionMetadata[0].key") + .value("keypometadatamock9")) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].transfer[0].transferMetadata[0].key") + .value("keytransfermetadatamock3")); + } + + @Test + void getDebtPositionByIUV_Custom_NAV_200() throws Exception { + PaymentPositionDTO pp = DebtPositionMock.getMock1(); + String iuv = "47999999999999999"; + pp.getPaymentOption().get(0).setIuv(iuv); + pp.getPaymentOption().forEach(po -> po.setNav("9"+auxDigit+po.getIuv())); + + // Creo una posizione debitoria settando il NAV e la recupero + mvc.perform(post("/organizations/20077777773/debtpositions") + .content(TestUtil.toJson(pp)).contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isCreated()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].nav") + .value("9"+auxDigit+iuv)); + String url = "/organizations/20077777773/paymentoptions/" + iuv + "/debtposition"; + mvc.perform(get(url).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].nav") + .value("9"+auxDigit+iuv)); + } + + @Test + void getDebtPositionByIUV_SegregationCodeAuthorized_200() throws Exception { + PaymentPositionDTO pp = DebtPositionMock.getMock1(); + String iuv = "47999999999999999"; + pp.getPaymentOption().get(0).setIuv(iuv); + String validSegregationCode = pp.getPaymentOption().get(0).getIuv().substring(0,2); + String anotherSegregationCode = "99"; + // creo una posizione debitoria e la recupero + mvc.perform(post("/organizations/20077777774/debtpositions") + .content(TestUtil.toJson(pp)).contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isCreated()); + + String url = "/organizations/20077777774/paymentoptions/" + iuv + "/debtposition?segregationCodes=" + validSegregationCode + "," + anotherSegregationCode; + mvc.perform(get(url).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.jsonPath("$.paymentOption[0].nav") + .value(auxDigit+iuv)); + } + + @Test + void getDebtPositionByIUV_SegregationCodeForbidden_403() throws Exception { + PaymentPositionDTO pp = DebtPositionMock.getMock1(); + String iuv = "47999999999999999"; + pp.getPaymentOption().get(0).setIuv(iuv); + String notSufficientSegregationCode = "99"; + mvc.perform(post("/organizations/40377777771/debtpositions") + .content(TestUtil.toJson(pp)).contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isCreated()); + String url = "/organizations/40377777771/paymentoptions/" + iuv + "/debtposition?segregationCodes=" + notSufficientSegregationCode; + mvc.perform(get(url).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isForbidden()); + } + + @Test + void getDebtPositionByIUV_404() throws Exception { + String NOT_EXISTENT_IUV = "00999999999999999"; + String url = "/organizations/40377777771/paymentoptions/" + NOT_EXISTENT_IUV + "/debtposition"; + mvc.perform(get(url).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)); + } + /** * GET DEBT POSITION BY IUPD */