From 5d58228cc4cfef8077a48e3c20eb5cc25c803066 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:11:54 +0100 Subject: [PATCH] feat: returning cheapest bundle for each psp PAGOPA-2348 --- openapi/openapi-node-v1.json | 729 +++++---- openapi/openapi-node-v2.json | 813 +++++----- openapi/openapi-v1-dev-uat.json | 1341 ++++++++--------- openapi/openapi-v1.json | 729 +++++---- openapi/openapi-v2.json | 813 +++++----- .../calculator/service/CalculatorService.java | 19 +- 6 files changed, 2130 insertions(+), 2314 deletions(-) diff --git a/openapi/openapi-node-v1.json b/openapi/openapi-node-v1.json index 47f662fc..1f1612c2 100644 --- a/openapi/openapi-node-v1.json +++ b/openapi/openapi-node-v1.json @@ -1,510 +1,481 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Calculator Logic", - "description": "Calculator Logic microservice for pagoPA AFM", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.32" + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Calculator Logic", + "description" : "Calculator Logic microservice for pagoPA AFM", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "2.10.32" }, - "servers": [ - { - "url": "http://localhost/", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Calculator", - "description": "Everything about Calculator business logic" - } - ], - "paths": { - "/psps/{idPsp}/fees": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of the specified idPSP", - "operationId": "getFeesByPsp", - "parameters": [ - { - "name": "idPsp", - "in": "path", - "description": "PSP identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } + "servers" : [ { + "url" : "http://localhost/", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Calculator", + "description" : "Everything about Calculator business logic" + } ], + "paths" : { + "/psps/{idPsp}/fees" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of the specified idPSP", + "operationId" : "getFeesByPsp", + "parameters" : [ { + "name" : "idPsp", + "in" : "path", + "description" : "PSP identifier", + "required" : true, + "schema" : { + "type" : "string" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOptionByPsp" + }, { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionByPsp" } } }, - "required": true + "required" : true }, - "responses": { - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/fees": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of all or specified idPSP", - "operationId": "getFees", - "parameters": [ - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } + "/fees" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of all or specified idPSP", + "operationId" : "getFees", + "parameters" : [ { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOption" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOption" } } }, - "required": true + "required" : true }, - "responses": { - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } } }, - "401": { - "description": "Unauthorized" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "403" : { + "description" : "Forbidden" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "403": { - "description": "Forbidden" - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } } }, - "components": { - "schemas": { - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "idChannel": { - "type": "string" + "components" : { + "schemas" : { + "PaymentOptionByPsp" : { + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "paymentAmount": { - "type": "integer", - "format": "int64" + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "primaryCreditorInstitution": { - "type": "string" + "primaryCreditorInstitution" : { + "type" : "string" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "bin": { - "type": "string" + "bin" : { + "type" : "string" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "transferCategory" : { + "type" : "string" }, - "digitalStamp": { - "type": "boolean" + "digitalStamp" : { + "type" : "boolean" } } }, - "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" } } }, - "BundleOption": { - "type": "object", - "properties": { - "belowThreshold": { - "type": "boolean", - "description": "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" - }, - "bundleOptions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transfer" + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + }, + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" } } } }, - "Transfer": { - "type": "object", - "properties": { - "taxPayerFee": { - "type": "integer", - "format": "int64" + "Transfer" : { + "type" : "object", + "properties" : { + "taxPayerFee" : { + "type" : "integer", + "format" : "int64" }, - "primaryCiIncurredFee": { - "type": "integer", - "format": "int64" + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "idBundle": { - "type": "string" + "idBundle" : { + "type" : "string" }, - "bundleName": { - "type": "string" + "bundleName" : { + "type" : "string" }, - "bundleDescription": { - "type": "string" + "bundleDescription" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "idCiBundle" : { + "type" : "string" }, - "idPsp": { - "type": "string" + "idPsp" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "onUs": { - "type": "boolean" + "onUs" : { + "type" : "boolean" }, - "abi": { - "type": "string" + "abi" : { + "type" : "string" }, - "pspBusinessName": { - "type": "string" + "pspBusinessName" : { + "type" : "string" } } }, - "PaymentOption": { - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ], - "type": "object", - "properties": { - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "bin": { - "type": "string" - }, - "paymentMethod": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" + "PaymentOption" : { + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ], + "type" : "object", + "properties" : { + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "primaryCreditorInstitution" : { + "type" : "string" + }, + "bin" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" } }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "PspSearchCriteria": { - "required": [ - "idPsp" - ], - "type": "object", - "properties": { - "idPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" + "PspSearchCriteria" : { + "required" : [ "idPsp" ], + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi-node-v2.json b/openapi/openapi-node-v2.json index bf335cb4..6120d8ff 100644 --- a/openapi/openapi-node-v2.json +++ b/openapi/openapi-node-v2.json @@ -1,548 +1,513 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Calculator Logic", - "description": "Calculator Logic microservice for pagoPA AFM", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.32" + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Calculator Logic", + "description" : "Calculator Logic microservice for pagoPA AFM", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "2.10.32" }, - "servers": [ - { - "url": "http://localhost/", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Calculator", - "description": "Everything about Calculator business logic" - } - ], - "paths": { - "/psps/{idPsp}/fees/multi": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of the specified idPSP with ECs contributions", - "operationId": "getFeesByPspMulti", - "parameters": [ - { - "name": "idPsp", - "in": "path", - "description": "PSP identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } + "servers" : [ { + "url" : "http://localhost/", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Calculator", + "description" : "Everything about Calculator business logic" + } ], + "paths" : { + "/psps/{idPsp}/fees/multi" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of the specified idPSP with ECs contributions", + "operationId" : "getFeesByPspMulti", + "parameters" : [ { + "name" : "idPsp", + "in" : "path", + "description" : "PSP identifier", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOptionByPspMulti" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionByPspMulti" } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/fees/multi": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of all or specified idPSP with ECs contributions", - "operationId": "getFeesMulti", - "parameters": [ - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } + "/fees/multi" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of all or specified idPSP with ECs contributions", + "operationId" : "getFeesMulti", + "parameters" : [ { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOptionMulti" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionMulti" } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } } }, - "401": { - "description": "Unauthorized" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "403" : { + "description" : "Forbidden" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "403": { - "description": "Forbidden" - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } } }, - "components": { - "schemas": { - "PaymentNoticeItem": { - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ], - "type": "object", - "properties": { - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "components" : { + "schemas" : { + "PaymentNoticeItem" : { + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ], + "type" : "object", + "properties" : { + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "primaryCreditorInstitution" : { + "type" : "string" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "PaymentOptionByPspMulti": { - "required": [ - "paymentNotice" - ], - "type": "object", - "properties": { - "idChannel": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "paymentMethod": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "bin": { - "type": "string" - }, - "paymentNotice": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentNoticeItem" + "PaymentOptionByPspMulti" : { + "required" : [ "paymentNotice" ], + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "bin" : { + "type" : "string" + }, + "paymentNotice" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNoticeItem" } } } }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "transferCategory" : { + "type" : "string" }, - "digitalStamp": { - "type": "boolean" + "digitalStamp" : { + "type" : "boolean" + } + } + }, + "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" } } }, - "BundleOption": { - "type": "object", - "properties": { - "belowThreshold": { - "type": "boolean", - "description": "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" - }, - "bundleOptions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transfer" + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + }, + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" } } } }, - "Fee": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" - }, - "primaryCiIncurredFee": { - "type": "integer", - "format": "int64" - }, - "actualCiIncurredFee": { - "type": "integer", - "format": "int64" + "Fee" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" + }, + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" + }, + "actualCiIncurredFee" : { + "type" : "integer", + "format" : "int64" } } }, - "Transfer": { - "required": [ - "fees" - ], - "type": "object", - "properties": { - "taxPayerFee": { - "type": "integer", - "format": "int64" - }, - "actualPayerFee": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "idBundle": { - "type": "string" - }, - "bundleName": { - "type": "string" - }, - "bundleDescription": { - "type": "string" - }, - "idsCiBundle": { - "type": "array", - "items": { - "type": "string" + "Transfer" : { + "required" : [ "fees" ], + "type" : "object", + "properties" : { + "taxPayerFee" : { + "type" : "integer", + "format" : "int64" + }, + "actualPayerFee" : { + "type" : "integer", + "format" : "int64" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idBundle" : { + "type" : "string" + }, + "bundleName" : { + "type" : "string" + }, + "bundleDescription" : { + "type" : "string" + }, + "idsCiBundle" : { + "type" : "array", + "items" : { + "type" : "string" } }, - "idPsp": { - "type": "string" + "idPsp" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "onUs": { - "type": "boolean" + "onUs" : { + "type" : "boolean" }, - "abi": { - "type": "string" + "abi" : { + "type" : "string" }, - "pspBusinessName": { - "type": "string" + "pspBusinessName" : { + "type" : "string" }, - "fees": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Fee" + "fees" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Fee" } } } }, - "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" - } - } - }, - "PaymentOptionMulti": { - "required": [ - "paymentNotice" - ], - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "paymentMethod": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" + "PaymentOptionMulti" : { + "required" : [ "paymentNotice" ], + "type" : "object", + "properties" : { + "bin" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" } }, - "paymentNotice": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentNoticeItem" + "paymentNotice" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNoticeItem" } } } }, - "PspSearchCriteria": { - "required": [ - "idPsp" - ], - "type": "object", - "properties": { - "idPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" + "PspSearchCriteria" : { + "required" : [ "idPsp" ], + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi-v1-dev-uat.json b/openapi/openapi-v1-dev-uat.json index 61301a2f..06c33c77 100644 --- a/openapi/openapi-v1-dev-uat.json +++ b/openapi/openapi-v1-dev-uat.json @@ -1,505 +1,466 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Calculator Logic", - "description": "Calculator Logic microservice for pagoPA AFM", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.32" + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Calculator Logic", + "description" : "Calculator Logic microservice for pagoPA AFM", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "2.10.32" }, - "servers": [ - { - "url": "http://localhost/", - "description": "Generated server url" + "servers" : [ { + "url" : "http://localhost/", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Calculator", + "description" : "Everything about Calculator business logic" + }, { + "name" : "Configuration", + "description" : "Utility Services" + }, { + "name" : "Actuator", + "description" : "Monitor and interact", + "externalDocs" : { + "description" : "Spring Boot Actuator Web API Documentation", + "url" : "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" } - ], - "tags": [ - { - "name": "Calculator", - "description": "Everything about Calculator business logic" - }, - { - "name": "Configuration", - "description": "Utility Services" - }, - { - "name": "Actuator", - "description": "Monitor and interact", - "externalDocs": { - "description": "Spring Boot Actuator Web API Documentation", - "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" - } - } - ], - "paths": { - "/psps/{idPsp}/fees": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of the specified idPSP", - "operationId": "getFeesByPsp", - "parameters": [ - { - "name": "idPsp", - "in": "path", - "description": "PSP identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOptionByPsp" + } ], + "paths" : { + "/psps/{idPsp}/fees" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of the specified idPSP", + "operationId" : "getFeesByPsp", + "parameters" : [ { + "name" : "idPsp", + "in" : "path", + "description" : "PSP identifier", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionByPsp" } } }, - "required": true + "required" : true }, - "responses": { - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/fees": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of all or specified idPSP", - "operationId": "getFees", - "parameters": [ - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOption" + "/fees" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of all or specified idPSP", + "operationId" : "getFees", + "parameters" : [ { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOption" } } }, - "required": true + "required" : true }, - "responses": { - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/configuration/touchpoint/delete": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "deleteTouchpoints", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Touchpoint" + "/configuration/touchpoint/delete" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "deleteTouchpoints", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Touchpoint" } } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "OK" + "responses" : { + "200" : { + "description" : "OK" } } } }, - "/configuration/touchpoint/add": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "addTouchpoints", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Touchpoint" + "/configuration/touchpoint/add" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "addTouchpoints", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Touchpoint" } } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "OK" + "responses" : { + "200" : { + "description" : "OK" } } } }, - "/configuration/paymenttypes/delete": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "deletePaymentTypes", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentType" + "/configuration/paymenttypes/delete" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "deletePaymentTypes", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentType" } } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "OK" + "responses" : { + "200" : { + "description" : "OK" } } } }, - "/configuration/paymenttypes/add": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "addPaymentTypes", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentType" + "/configuration/paymenttypes/add" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "addPaymentTypes", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentType" } } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "OK" + "responses" : { + "200" : { + "description" : "OK" } } } }, - "/configuration/bundles/delete": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "deleteValidBundles", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidBundle" + "/configuration/bundles/delete" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "deleteValidBundles", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValidBundle" } } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "OK" + "responses" : { + "200" : { + "description" : "OK" } } } }, - "/configuration/bundles/add": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "addValidBundles", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidBundle" + "/configuration/bundles/add" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "addValidBundles", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValidBundle" } } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "OK" + "responses" : { + "200" : { + "description" : "OK" } } } }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } } }, - "401": { - "description": "Unauthorized" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "403" : { + "description" : "Forbidden" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "403": { - "description": "Forbidden" - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/actuator": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator root web endpoint", - "operationId": "links", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" + "/actuator" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator root web endpoint", + "operationId" : "links", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Link" } } } }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Link" } } } }, - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Link" } } } @@ -509,30 +470,28 @@ } } }, - "/actuator/info": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'info'", - "operationId": "info", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" + "/actuator/info" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator web endpoint 'info'", + "operationId" : "info", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object" } }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object" } }, - "application/json": { - "schema": { - "type": "object" + "application/json" : { + "schema" : { + "type" : "object" } } } @@ -540,30 +499,28 @@ } } }, - "/actuator/health": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'health'", - "operationId": "health", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" + "/actuator/health" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator web endpoint 'health'", + "operationId" : "health", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object" } }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object" } }, - "application/json": { - "schema": { - "type": "object" + "application/json" : { + "schema" : { + "type" : "object" } } } @@ -571,30 +528,28 @@ } } }, - "/actuator/health/**": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'health-path'", - "operationId": "health-path", - "responses": { - "200": { - "description": "OK", - "content": { - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object" + "/actuator/health/**" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator web endpoint 'health-path'", + "operationId" : "health-path", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object" } }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object" } }, - "application/json": { - "schema": { - "type": "object" + "application/json" : { + "schema" : { + "type" : "object" } } } @@ -603,389 +558,365 @@ } } }, - "components": { - "schemas": { - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "idChannel": { - "type": "string" + "components" : { + "schemas" : { + "PaymentOptionByPsp" : { + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "paymentAmount": { - "type": "integer", - "format": "int64" + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "primaryCreditorInstitution": { - "type": "string" + "primaryCreditorInstitution" : { + "type" : "string" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "bin": { - "type": "string" + "bin" : { + "type" : "string" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "transferCategory" : { + "type" : "string" }, - "digitalStamp": { - "type": "boolean" + "digitalStamp" : { + "type" : "boolean" } } }, - "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" } } }, - "BundleOption": { - "type": "object", - "properties": { - "belowThreshold": { - "type": "boolean", - "description": "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" }, - "bundleOptions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transfer" + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" } } } }, - "Transfer": { - "type": "object", - "properties": { - "taxPayerFee": { - "type": "integer", - "format": "int64" + "Transfer" : { + "type" : "object", + "properties" : { + "taxPayerFee" : { + "type" : "integer", + "format" : "int64" }, - "primaryCiIncurredFee": { - "type": "integer", - "format": "int64" + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "idBundle": { - "type": "string" + "idBundle" : { + "type" : "string" }, - "bundleName": { - "type": "string" + "bundleName" : { + "type" : "string" }, - "bundleDescription": { - "type": "string" + "bundleDescription" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "idCiBundle" : { + "type" : "string" }, - "idPsp": { - "type": "string" + "idPsp" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "onUs": { - "type": "boolean" + "onUs" : { + "type" : "boolean" }, - "abi": { - "type": "string" + "abi" : { + "type" : "string" }, - "pspBusinessName": { - "type": "string" + "pspBusinessName" : { + "type" : "string" } } }, - "PaymentOption": { - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ], - "type": "object", - "properties": { - "paymentAmount": { - "type": "integer", - "format": "int64" + "PaymentOption" : { + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ], + "type" : "object", + "properties" : { + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "primaryCreditorInstitution": { - "type": "string" + "primaryCreditorInstitution" : { + "type" : "string" }, - "bin": { - "type": "string" + "bin" : { + "type" : "string" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" } }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "PspSearchCriteria": { - "required": [ - "idPsp" - ], - "type": "object", - "properties": { - "idPsp": { - "type": "string" + "PspSearchCriteria" : { + "required" : [ "idPsp" ], + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" } } }, - "Touchpoint": { - "type": "object", - "properties": { - "id": { - "type": "string" + "Touchpoint" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" }, - "name": { - "type": "string" + "name" : { + "type" : "string" }, - "creationDate": { - "type": "string", - "format": "date-time" + "creationDate" : { + "type" : "string", + "format" : "date-time" } } }, - "PaymentType": { - "required": [ - "id", - "name" - ], - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "createdDate": { - "type": "string", - "format": "date-time" + "PaymentType" : { + "required" : [ "id", "name" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "createdDate" : { + "type" : "string", + "format" : "date-time" } } }, - "CiBundle": { - "required": [ - "ciFiscalCode", - "id" - ], - "type": "object", - "properties": { - "id": { - "type": "string" + "CiBundle" : { + "required" : [ "ciFiscalCode", "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" }, - "ciFiscalCode": { - "type": "string" + "ciFiscalCode" : { + "type" : "string" }, - "attributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundleAttribute" + "attributes" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CiBundleAttribute" } } } }, - "CiBundleAttribute": { - "required": [ - "id" - ], - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "transferCategory": { - "type": "string" - }, - "transferCategoryRelation": { - "type": "string", - "enum": [ - "EQUAL", - "NOT_EQUAL" - ] + "CiBundleAttribute" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "maxPaymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "transferCategory" : { + "type" : "string" + }, + "transferCategoryRelation" : { + "type" : "string", + "enum" : [ "EQUAL", "NOT_EQUAL" ] } } }, - "ValidBundle": { - "required": [ - "digitalStamp", - "digitalStampRestriction" - ], - "type": "object", - "properties": { - "id": { - "type": "string" + "ValidBundle" : { + "required" : [ "digitalStamp", "digitalStampRestriction" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" }, - "idPsp": { - "type": "string" + "idPsp" : { + "type" : "string" }, - "abi": { - "type": "string" + "abi" : { + "type" : "string" }, - "pspBusinessName": { - "type": "string" + "pspBusinessName" : { + "type" : "string" }, - "name": { - "type": "string" + "name" : { + "type" : "string" }, - "description": { - "type": "string" + "description" : { + "type" : "string" }, - "paymentAmount": { - "type": "integer", - "format": "int64" + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "minPaymentAmount": { - "type": "integer", - "format": "int64" + "minPaymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" + "maxPaymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "paymentType": { - "type": "string" + "paymentType" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "type": { - "type": "string", - "enum": [ - "GLOBAL", - "PUBLIC", - "PRIVATE" - ] + "type" : { + "type" : "string", + "enum" : [ "GLOBAL", "PUBLIC", "PRIVATE" ] }, - "transferCategoryList": { - "type": "array", - "items": { - "type": "string" + "transferCategoryList" : { + "type" : "array", + "items" : { + "type" : "string" } }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "digitalStamp": { - "type": "boolean" + "digitalStamp" : { + "type" : "boolean" }, - "digitalStampRestriction": { - "type": "boolean" + "digitalStampRestriction" : { + "type" : "boolean" }, - "onUs": { - "type": "boolean" + "onUs" : { + "type" : "boolean" }, - "ciBundleList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundle" + "ciBundleList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CiBundle" } } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } }, - "Link": { - "type": "object", - "properties": { - "href": { - "type": "string" + "Link" : { + "type" : "object", + "properties" : { + "href" : { + "type" : "string" }, - "templated": { - "type": "boolean" + "templated" : { + "type" : "boolean" } } } }, - "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" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi-v1.json b/openapi/openapi-v1.json index 47f662fc..1f1612c2 100644 --- a/openapi/openapi-v1.json +++ b/openapi/openapi-v1.json @@ -1,510 +1,481 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Calculator Logic", - "description": "Calculator Logic microservice for pagoPA AFM", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.32" + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Calculator Logic", + "description" : "Calculator Logic microservice for pagoPA AFM", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "2.10.32" }, - "servers": [ - { - "url": "http://localhost/", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Calculator", - "description": "Everything about Calculator business logic" - } - ], - "paths": { - "/psps/{idPsp}/fees": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of the specified idPSP", - "operationId": "getFeesByPsp", - "parameters": [ - { - "name": "idPsp", - "in": "path", - "description": "PSP identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } + "servers" : [ { + "url" : "http://localhost/", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Calculator", + "description" : "Everything about Calculator business logic" + } ], + "paths" : { + "/psps/{idPsp}/fees" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of the specified idPSP", + "operationId" : "getFeesByPsp", + "parameters" : [ { + "name" : "idPsp", + "in" : "path", + "description" : "PSP identifier", + "required" : true, + "schema" : { + "type" : "string" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOptionByPsp" + }, { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionByPsp" } } }, - "required": true + "required" : true }, - "responses": { - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/fees": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of all or specified idPSP", - "operationId": "getFees", - "parameters": [ - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } + "/fees" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of all or specified idPSP", + "operationId" : "getFees", + "parameters" : [ { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOption" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOption" } } }, - "required": true + "required" : true }, - "responses": { - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } } }, - "401": { - "description": "Unauthorized" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "403" : { + "description" : "Forbidden" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "403": { - "description": "Forbidden" - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } } }, - "components": { - "schemas": { - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "idChannel": { - "type": "string" + "components" : { + "schemas" : { + "PaymentOptionByPsp" : { + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "paymentAmount": { - "type": "integer", - "format": "int64" + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "primaryCreditorInstitution": { - "type": "string" + "primaryCreditorInstitution" : { + "type" : "string" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "bin": { - "type": "string" + "bin" : { + "type" : "string" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "transferCategory" : { + "type" : "string" }, - "digitalStamp": { - "type": "boolean" + "digitalStamp" : { + "type" : "boolean" } } }, - "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" } } }, - "BundleOption": { - "type": "object", - "properties": { - "belowThreshold": { - "type": "boolean", - "description": "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" - }, - "bundleOptions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transfer" + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + }, + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" } } } }, - "Transfer": { - "type": "object", - "properties": { - "taxPayerFee": { - "type": "integer", - "format": "int64" + "Transfer" : { + "type" : "object", + "properties" : { + "taxPayerFee" : { + "type" : "integer", + "format" : "int64" }, - "primaryCiIncurredFee": { - "type": "integer", - "format": "int64" + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "idBundle": { - "type": "string" + "idBundle" : { + "type" : "string" }, - "bundleName": { - "type": "string" + "bundleName" : { + "type" : "string" }, - "bundleDescription": { - "type": "string" + "bundleDescription" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "idCiBundle" : { + "type" : "string" }, - "idPsp": { - "type": "string" + "idPsp" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "onUs": { - "type": "boolean" + "onUs" : { + "type" : "boolean" }, - "abi": { - "type": "string" + "abi" : { + "type" : "string" }, - "pspBusinessName": { - "type": "string" + "pspBusinessName" : { + "type" : "string" } } }, - "PaymentOption": { - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ], - "type": "object", - "properties": { - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "bin": { - "type": "string" - }, - "paymentMethod": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" + "PaymentOption" : { + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ], + "type" : "object", + "properties" : { + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "primaryCreditorInstitution" : { + "type" : "string" + }, + "bin" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" } }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "PspSearchCriteria": { - "required": [ - "idPsp" - ], - "type": "object", - "properties": { - "idPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" + "PspSearchCriteria" : { + "required" : [ "idPsp" ], + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi-v2.json b/openapi/openapi-v2.json index bf335cb4..6120d8ff 100644 --- a/openapi/openapi-v2.json +++ b/openapi/openapi-v2.json @@ -1,548 +1,513 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Calculator Logic", - "description": "Calculator Logic microservice for pagoPA AFM", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.32" + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Calculator Logic", + "description" : "Calculator Logic microservice for pagoPA AFM", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "2.10.32" }, - "servers": [ - { - "url": "http://localhost/", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Calculator", - "description": "Everything about Calculator business logic" - } - ], - "paths": { - "/psps/{idPsp}/fees/multi": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of the specified idPSP with ECs contributions", - "operationId": "getFeesByPspMulti", - "parameters": [ - { - "name": "idPsp", - "in": "path", - "description": "PSP identifier", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } + "servers" : [ { + "url" : "http://localhost/", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Calculator", + "description" : "Everything about Calculator business logic" + } ], + "paths" : { + "/psps/{idPsp}/fees/multi" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of the specified idPSP with ECs contributions", + "operationId" : "getFeesByPspMulti", + "parameters" : [ { + "name" : "idPsp", + "in" : "path", + "description" : "PSP identifier", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOptionByPspMulti" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionByPspMulti" } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/fees/multi": { - "post": { - "tags": [ - "Calculator" - ], - "summary": "Get taxpayer fees of all or specified idPSP with ECs contributions", - "operationId": "getFeesMulti", - "parameters": [ - { - "name": "maxOccurrences", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "allCcp", - "in": "query", - "description": "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", - "required": false, - "schema": { - "type": "string", - "default": "true" - } + "/fees/multi" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of all or specified idPSP with ECs contributions", + "operationId" : "getFeesMulti", + "parameters" : [ { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOptionMulti" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionMulti" } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } } }, - "401": { - "description": "Unauthorized" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Unauthorized" + }, + "403" : { + "description" : "Forbidden" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - }, - "403": { - "description": "Forbidden" - }, - "429": { - "description": "Too many requests" } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } } }, - "components": { - "schemas": { - "PaymentNoticeItem": { - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ], - "type": "object", - "properties": { - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "components" : { + "schemas" : { + "PaymentNoticeItem" : { + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ], + "type" : "object", + "properties" : { + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "primaryCreditorInstitution" : { + "type" : "string" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "PaymentOptionByPspMulti": { - "required": [ - "paymentNotice" - ], - "type": "object", - "properties": { - "idChannel": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "paymentMethod": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "bin": { - "type": "string" - }, - "paymentNotice": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentNoticeItem" + "PaymentOptionByPspMulti" : { + "required" : [ "paymentNotice" ], + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "bin" : { + "type" : "string" + }, + "paymentNotice" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNoticeItem" } } } }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "transferCategory" : { + "type" : "string" }, - "digitalStamp": { - "type": "boolean" + "digitalStamp" : { + "type" : "boolean" + } + } + }, + "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" } } }, - "BundleOption": { - "type": "object", - "properties": { - "belowThreshold": { - "type": "boolean", - "description": "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" - }, - "bundleOptions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transfer" + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + }, + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" } } } }, - "Fee": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" - }, - "primaryCiIncurredFee": { - "type": "integer", - "format": "int64" - }, - "actualCiIncurredFee": { - "type": "integer", - "format": "int64" + "Fee" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" + }, + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" + }, + "actualCiIncurredFee" : { + "type" : "integer", + "format" : "int64" } } }, - "Transfer": { - "required": [ - "fees" - ], - "type": "object", - "properties": { - "taxPayerFee": { - "type": "integer", - "format": "int64" - }, - "actualPayerFee": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "idBundle": { - "type": "string" - }, - "bundleName": { - "type": "string" - }, - "bundleDescription": { - "type": "string" - }, - "idsCiBundle": { - "type": "array", - "items": { - "type": "string" + "Transfer" : { + "required" : [ "fees" ], + "type" : "object", + "properties" : { + "taxPayerFee" : { + "type" : "integer", + "format" : "int64" + }, + "actualPayerFee" : { + "type" : "integer", + "format" : "int64" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idBundle" : { + "type" : "string" + }, + "bundleName" : { + "type" : "string" + }, + "bundleDescription" : { + "type" : "string" + }, + "idsCiBundle" : { + "type" : "array", + "items" : { + "type" : "string" } }, - "idPsp": { - "type": "string" + "idPsp" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "onUs": { - "type": "boolean" + "onUs" : { + "type" : "boolean" }, - "abi": { - "type": "string" + "abi" : { + "type" : "string" }, - "pspBusinessName": { - "type": "string" + "pspBusinessName" : { + "type" : "string" }, - "fees": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Fee" + "fees" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Fee" } } } }, - "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" - } - } - }, - "PaymentOptionMulti": { - "required": [ - "paymentNotice" - ], - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "paymentMethod": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" + "PaymentOptionMulti" : { + "required" : [ "paymentNotice" ], + "type" : "object", + "properties" : { + "bin" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" } }, - "paymentNotice": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentNoticeItem" + "paymentNotice" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNoticeItem" } } } }, - "PspSearchCriteria": { - "required": [ - "idPsp" - ], - "type": "object", - "properties": { - "idPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" + "PspSearchCriteria" : { + "required" : [ "idPsp" ], + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java b/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java index 5775b556..74cd36e6 100644 --- a/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java +++ b/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java @@ -138,7 +138,7 @@ private List calculateTaxPayerFee( private List calculateTaxPayerFeeMulti( PaymentOptionMulti paymentOption, int limit, List bundles) { - List transfers = new ArrayList<>(); + Map pspTransfersMap = new HashMap<>(); // 1. Check if ONUS payment: // - ONUS payment = if the bundle ABI attribute matching the one extracted via BIN from the @@ -168,15 +168,18 @@ private List calcul // 2.a: if ONUS payment -> return the transfer list only for bundles with the idChannel // attribute ending in '_ONUS' if (isOnusPaymentType && isOnusBundle(bundle)) { - transfers.addAll(this.getTransferList(paymentOption, bundle)); + addToPspTransfersMap(pspTransfersMap, this.getTransferList(paymentOption, bundle)); } // 2.b: if not ONUS payment -> return the transfer list only for bundles with the idChannel // attribute NOT ending in '_ONUS' if (!isOnusPaymentType && !isOnusBundle(bundle)) { - transfers.addAll(this.getTransferList(paymentOption, bundle)); + addToPspTransfersMap(pspTransfersMap, this.getTransferList(paymentOption, bundle)); } } + // convert mapping of psp and transfer to transfer list + List transfers = new ArrayList<>(pspTransfersMap.values()); + // if it is a payment on the AMEX circuit --> filter to return only AMEX_ONUS if (this.isAMEXAbi(issuers)) { Predicate abiPredicate = t -> amexABI.equalsIgnoreCase(t.getAbi()); @@ -518,6 +521,16 @@ private boolean isBelowThreshold(long paymentAmount) { return paymentAmount < Long.parseLong(StringUtils.trim(amountThreshold)); } + private void addToPspTransfersMap(Map pspTransferMap, + List transferList) { + for(it.gov.pagopa.afm.calculator.model.calculatormulti.Transfer transfer : transferList) { + if(!pspTransferMap.containsKey(transfer.getIdPsp()) || + pspTransferMap.get(transfer.getIdPsp()).getActualPayerFee() > transfer.getActualPayerFee()) { + pspTransferMap.put(transfer.getIdPsp(), transfer); + } + } + } + /** * sort by bundles' fee grouped by PSP *