From de0b62e7b61a673d75a91e19c6eb6883b1a334d1 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:45:24 +0100 Subject: [PATCH 1/4] PAGOPA-1172 adding api definitions and openapi files --- openapi/generate_openapi_v1_v2.sh | 7 + openapi/openapi_v1.json | 922 ++++++++++++++++++ openapi/openapi_v2.json | 481 +++++++++ .../controller/CalculatorController.java | 148 +++ src/main/resources/application.properties | 9 +- .../afm/calculator/OpenApiGenerationTest.java | 55 ++ src/test/resources/application.properties | 11 + 7 files changed, 1632 insertions(+), 1 deletion(-) create mode 100644 openapi/generate_openapi_v1_v2.sh create mode 100644 openapi/openapi_v1.json create mode 100644 openapi/openapi_v2.json create mode 100644 src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java diff --git a/openapi/generate_openapi_v1_v2.sh b/openapi/generate_openapi_v1_v2.sh new file mode 100644 index 00000000..228a14d0 --- /dev/null +++ b/openapi/generate_openapi_v1_v2.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ "$(pwd)" =~ .*"openapi".* ]]; then + cd .. +fi + +mvn test -Dtest=OpenApiGenerationTest diff --git a/openapi/openapi_v1.json b/openapi/openapi_v1.json new file mode 100644 index 00000000..373ccac8 --- /dev/null +++ b/openapi/openapi_v1.json @@ -0,0 +1,922 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Calculator Logic", + "description" : "@project.description@", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "@project.version@" + }, + "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/" + } + } ], + "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 + }, + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "401" : { + "description" : "Unauthorized" + }, + "429" : { + "description" : "Too many requests" + }, + "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" + } + } + } + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + } + }, + "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" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "401" : { + "description" : "Unauthorized" + }, + "429" : { + "description" : "Too many requests" + }, + "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" + } + } + } + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + } + }, + "security" : [ { + "ApiKey" : [ ] + } ] + } + }, + "/configuration/touchpoint/delete" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "deleteTouchpoints", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Touchpoint" + } + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK" + } + } + } + }, + "/configuration/touchpoint/add" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "addTouchpoints", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Touchpoint" + } + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK" + } + } + } + }, + "/configuration/paymenttypes/delete" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "deletePaymentTypes", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentType" + } + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK" + } + } + } + }, + "/configuration/paymenttypes/add" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "addPaymentTypes", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentType" + } + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK" + } + } + } + }, + "/configuration/bundles/delete" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "deleteValidBundles", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValidBundle" + } + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK" + } + } + } + }, + "/configuration/bundles/add" : { + "post" : { + "tags" : [ "Configuration" ], + "operationId" : "addValidBundles", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValidBundle" + } + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK" + } + } + } + }, + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "403" : { + "description" : "Forbidden" + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "401" : { + "description" : "Unauthorized" + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" + } + } + } + }, + "429" : { + "description" : "Too many requests" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + } + } + } + } + } + }, + "/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/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/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/json" : { + "schema" : { + "type" : "object" + } + } + } + } + } + } + } + }, + "components" : { + "schemas" : { + "PaymentOptionByPsp" : { + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "primaryCreditorInstitution" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "bin" : { + "type" : "string" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" + } + } + } + }, + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" + }, + "transferCategory" : { + "type" : "string" + }, + "digitalStamp" : { + "type" : "boolean" + } + } + }, + "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" + }, + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idBundle" : { + "type" : "string" + }, + "bundleName" : { + "type" : "string" + }, + "bundleDescription" : { + "type" : "string" + }, + "idCiBundle" : { + "type" : "string" + }, + "idPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "onUs" : { + "type" : "boolean" + }, + "abi" : { + "type" : "string" + }, + "pspBusinessName" : { + "type" : "string" + } + } + }, + "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" + } + } + }, + "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" + } + } + } + }, + "PspSearchCriteria" : { + "required" : [ "idPsp" ], + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + } + } + }, + "Touchpoint" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "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" + } + } + }, + "CiBundle" : { + "required" : [ "ciFiscalCode", "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "ciFiscalCode" : { + "type" : "string" + }, + "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" ] + } + } + }, + "ValidBundle" : { + "required" : [ "digitalStamp", "digitalStampRestriction" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "idPsp" : { + "type" : "string" + }, + "abi" : { + "type" : "string" + }, + "pspBusinessName" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "minPaymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "maxPaymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "paymentType" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "type" : { + "type" : "string", + "enum" : [ "GLOBAL", "PUBLIC", "PRIVATE" ] + }, + "transferCategoryList" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "digitalStamp" : { + "type" : "boolean" + }, + "digitalStampRestriction" : { + "type" : "boolean" + }, + "onUs" : { + "type" : "boolean" + }, + "ciBundleList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CiBundle" + } + } + } + }, + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "environment" : { + "type" : "string" + } + } + }, + "Link" : { + "type" : "object", + "properties" : { + "href" : { + "type" : "string" + }, + "templated" : { + "type" : "boolean" + } + } + } + }, + "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 new file mode 100644 index 00000000..5cb28dbc --- /dev/null +++ b/openapi/openapi_v2.json @@ -0,0 +1,481 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Calculator Logic", + "description" : "@project.description@", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "@project.version@" + }, + "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/PaymentOptionByPsp" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "401" : { + "description" : "Unauthorized" + }, + "429" : { + "description" : "Too many requests" + }, + "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" + } + } + } + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + } + }, + "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" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOption" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "401" : { + "description" : "Unauthorized" + }, + "429" : { + "description" : "Too many requests" + }, + "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" + } + } + } + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + } + }, + "security" : [ { + "ApiKey" : [ ] + } ] + } + }, + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "403" : { + "description" : "Forbidden" + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "401" : { + "description" : "Unauthorized" + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" + } + } + } + }, + "429" : { + "description" : "Too many requests" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + } + }, + "security" : [ { + "ApiKey" : [ ] + } ] + } + } + }, + "components" : { + "schemas" : { + "PaymentOptionByPsp" : { + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "primaryCreditorInstitution" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "bin" : { + "type" : "string" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" + } + } + } + }, + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" + }, + "transferCategory" : { + "type" : "string" + }, + "digitalStamp" : { + "type" : "boolean" + } + } + }, + "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" + }, + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idBundle" : { + "type" : "string" + }, + "bundleName" : { + "type" : "string" + }, + "bundleDescription" : { + "type" : "string" + }, + "idCiBundle" : { + "type" : "string" + }, + "idPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "onUs" : { + "type" : "boolean" + }, + "abi" : { + "type" : "string" + }, + "pspBusinessName" : { + "type" : "string" + } + } + }, + "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" + } + } + }, + "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" + } + } + } + }, + "PspSearchCriteria" : { + "required" : [ "idPsp" ], + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + } + } + }, + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "version" : { + "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" + } + } + } +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/afm/calculator/controller/CalculatorController.java b/src/main/java/it/gov/pagopa/afm/calculator/controller/CalculatorController.java index 2f48acf7..dad23228 100644 --- a/src/main/java/it/gov/pagopa/afm/calculator/controller/CalculatorController.java +++ b/src/main/java/it/gov/pagopa/afm/calculator/controller/CalculatorController.java @@ -180,4 +180,152 @@ public BundleOption getFees( return calculatorService.calculate( paymentOption, maxOccurrences, StringUtils.isBlank(allCcp) || Boolean.parseBoolean(allCcp)); } + + @Operation( + summary = "Get taxpayer fees of the specified idPSP with ECs contributions", + security = {@SecurityRequirement(name = "ApiKey")}, + tags = {"Calculator"}) + @ApiResponses( + value = { + @ApiResponse( + responseCode = "200", + description = "Ok", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = BundleOption.class))), + @ApiResponse( + responseCode = "400", + description = "Bad Request", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))), + @ApiResponse( + responseCode = "401", + description = "Unauthorized", + content = @Content(schema = @Schema())), + @ApiResponse( + responseCode = "404", + description = "Not Found", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))), + @ApiResponse( + responseCode = "422", + description = "Unable to process the request", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests", + content = @Content(schema = @Schema())), + @ApiResponse( + responseCode = "500", + description = "Service unavailable", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))) + }) + @PostMapping( + value = "/psps/{idPsp}/fees/multi", + produces = {MediaType.APPLICATION_JSON_VALUE}) + public BundleOption getFeesByPspMulti( + @Parameter(description = "PSP identifier", required = true) @PathVariable("idPsp") + String idPsp, + @RequestBody @Valid PaymentOptionByPsp paymentOptionByPsp, + @RequestParam(required = false, defaultValue = "10") Integer maxOccurrences, + @RequestParam(required = false, defaultValue = "true") + @Parameter( + description = + "Flag for the exclusion of Poste bundles: false -> excluded, true or null ->" + + " included") + String allCcp) { + PaymentOption paymentOption = + PaymentOption.builder() + .paymentAmount(paymentOptionByPsp.getPaymentAmount()) + .primaryCreditorInstitution(paymentOptionByPsp.getPrimaryCreditorInstitution()) + .paymentMethod(paymentOptionByPsp.getPaymentMethod()) + .touchpoint(paymentOptionByPsp.getTouchpoint()) + .idPspList( + List.of( + PspSearchCriteria.builder() + .idPsp(idPsp) + .idChannel(paymentOptionByPsp.getIdChannel()) + .idBrokerPsp(paymentOptionByPsp.getIdBrokerPsp()) + .build())) + .transferList(paymentOptionByPsp.getTransferList()) + .bin(paymentOptionByPsp.getBin()) + .build(); + return null; + } + + @Operation( + summary = "Get taxpayer fees of all or specified idPSP with ECs contributions", + security = {@SecurityRequirement(name = "ApiKey")}, + tags = {"Calculator"}) + @ApiResponses( + value = { + @ApiResponse( + responseCode = "200", + description = "Ok", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = BundleOption.class))), + @ApiResponse( + responseCode = "400", + description = "Bad Request", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))), + @ApiResponse( + responseCode = "401", + description = "Unauthorized", + content = @Content(schema = @Schema())), + @ApiResponse( + responseCode = "404", + description = "Not Found", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))), + @ApiResponse( + responseCode = "422", + description = "Unable to process the request", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests", + content = @Content(schema = @Schema())), + @ApiResponse( + responseCode = "500", + description = "Service unavailable", + content = + @Content( + mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = ProblemJson.class))) + }) + @PostMapping( + value = "/fees/multi", + produces = {MediaType.APPLICATION_JSON_VALUE}) + public BundleOption getFeesMulti( + @RequestBody @Valid PaymentOption paymentOption, + @RequestParam(required = false, defaultValue = "10") Integer maxOccurrences, + @RequestParam(required = false, defaultValue = "true") + @Parameter( + description = + "Flag for the exclusion of Poste bundles: false -> excluded, true or null ->" + + " included") + String allCcp) { + return null; + } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index afd12f7e..4b13cd25 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -13,8 +13,15 @@ management.health.livenessState.enabled=true management.health.readinessState.enabled=true # Openapi -springdoc.writer-with-order-by-keys=true +springdoc.writer-with-order-by-keys=false springdoc.writer-with-default-pretty-printer=true +springdoc.api-docs.groups.enabled=true +springdoc.group-configs[0].group=v1 +springdoc.group-configs[0].displayName=API AFM-Calculator v1 +springdoc.group-configs[0].paths-to-exclude=/**/multi +springdoc.group-configs[1].group=v2 +springdoc.group-configs[1].displayName=API AFM-Calculator v2 +springdoc.group-configs[1].paths-to-match=/**/multi,/info # Server server.servlet.context-path=/ diff --git a/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java b/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java new file mode 100644 index 00000000..c30ce768 --- /dev/null +++ b/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java @@ -0,0 +1,55 @@ +package it.gov.pagopa.afm.calculator; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.result.MockMvcResultMatchers; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +@SpringBootTest +@AutoConfigureMockMvc +class OpenApiGenerationTest { + + @Autowired + ObjectMapper objectMapper; + + @Autowired + private MockMvc mvc; + + @Test + void swaggerSpringPlugin() throws Exception { + saveOpenAPI("/v3/api-docs/v1/", "openapi_v1.json"); + saveOpenAPI("/v3/api-docs/v2", "openapi_v2.json"); + } + + private void saveOpenAPI(String fromUri, String toFile) throws Exception { + mvc.perform(MockMvcRequestBuilders.get(fromUri).accept(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.status().is2xxSuccessful()) + .andDo( + (result) -> { + assertNotNull(result); + assertNotNull(result.getResponse()); + final String content = result.getResponse().getContentAsString(); + assertFalse(content.isBlank()); + assertFalse(content.contains("${"), "Generated swagger contains placeholders"); + Object swagger = + objectMapper.readValue(result.getResponse().getContentAsString(), Object.class); + String formatted = + objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(swagger); + Path basePath = Paths.get("openapi/"); + Files.createDirectories(basePath); + Files.write(basePath.resolve(toFile), formatted.getBytes()); + }); + } +} diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 8f3fb319..dee92202 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -42,3 +42,14 @@ payment.amount.threshold=0 # PSP Poste pspPoste.id=testIdPspPoste + +# Openapi +springdoc.writer-with-order-by-keys=false +springdoc.writer-with-default-pretty-printer=true +springdoc.api-docs.groups.enabled=true +springdoc.group-configs[0].group=v1 +springdoc.group-configs[0].displayName=API AFM-Calculator v1 +springdoc.group-configs[0].paths-to-exclude=/**/multi +springdoc.group-configs[1].group=v2 +springdoc.group-configs[1].displayName=API AFM-Calculator v2 +springdoc.group-configs[1].paths-to-match=/**/multi,/info From d4e043bf3280dce65d36010e1bfb4b3d14873835 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:14:43 +0100 Subject: [PATCH 2/4] PAGOPA-1172 adding return for testing --- .../afm/calculator/controller/CalculatorController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/it/gov/pagopa/afm/calculator/controller/CalculatorController.java b/src/main/java/it/gov/pagopa/afm/calculator/controller/CalculatorController.java index dad23228..4cb29478 100644 --- a/src/main/java/it/gov/pagopa/afm/calculator/controller/CalculatorController.java +++ b/src/main/java/it/gov/pagopa/afm/calculator/controller/CalculatorController.java @@ -261,7 +261,9 @@ public BundleOption getFeesByPspMulti( .transferList(paymentOptionByPsp.getTransferList()) .bin(paymentOptionByPsp.getBin()) .build(); - return null; + return BundleOption.builder() + .belowThreshold(false) + .build(); } @Operation( @@ -326,6 +328,8 @@ public BundleOption getFeesMulti( "Flag for the exclusion of Poste bundles: false -> excluded, true or null ->" + " included") String allCcp) { - return null; + return BundleOption.builder() + .belowThreshold(false) + .build(); } } From c282c198e77b2b2de09681bced47dcd45d76fd77 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Wed, 31 Jan 2024 14:17:10 +0000 Subject: [PATCH 3/4] Bump to version 2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2 [skip ci] --- helm/Chart.yaml | 4 +- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi-node.json | 2 +- openapi/openapi.json | 2 +- openapi/openapi_v1.json | 1329 +++++++++++++++++++------------------ openapi/openapi_v2.json | 717 ++++++++++---------- pom.xml | 2 +- 9 files changed, 1080 insertions(+), 982 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index aa3025e6..6ea31676 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-afm-calculator description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application -version: 2.12.0 -appVersion: 2.10.3 +version: 2.13.0 +appVersion: 2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2 dependencies: - name: microservice-chart version: 2.4.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 4c56d199..5d58d81d 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-afm-calculator - tag: "2.10.3" + tag: "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 405f2bef..8b4d2cca 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-afm-calculator - tag: "2.10.3" + tag: "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 475a66af..28e7210d 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-afm-calculator - tag: "2.10.3" + tag: "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi-node.json b/openapi/openapi-node.json index 66a50ebc..9cb2cb8a 100644 --- a/openapi/openapi-node.json +++ b/openapi/openapi-node.json @@ -4,7 +4,7 @@ "title": "PagoPA API Calculator Logic for Node", "description": "Calculator Logic microservice for pagoPA AFM", "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.3" + "version": "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" }, "servers": [ { diff --git a/openapi/openapi.json b/openapi/openapi.json index 361e22a5..5132b9ec 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "PagoPA API Calculator Logic", "description": "Calculator Logic microservice for pagoPA AFM", "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.3" + "version": "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" }, "servers": [ { diff --git a/openapi/openapi_v1.json b/openapi/openapi_v1.json index 373ccac8..30f59dca 100644 --- a/openapi/openapi_v1.json +++ b/openapi/openapi_v1.json @@ -1,466 +1,505 @@ { - "openapi" : "3.0.1", - "info" : { - "title" : "PagoPA API Calculator Logic", - "description" : "@project.description@", - "termsOfService" : "https://www.pagopa.gov.it/", - "version" : "@project.version@" + "openapi": "3.0.1", + "info": { + "title": "PagoPA API Calculator Logic", + "description": "@project.description@", + "termsOfService": "https://www.pagopa.gov.it/", + "version": "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" }, - "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/" + "servers": [ + { + "url": "http://localhost/", + "description": "Generated server url" } - } ], - "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" + ], + "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" } } }, - "required" : true + "required": true }, - "responses" : { - "200" : { - "description" : "Ok", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BundleOption" + "responses": { + "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" + "401": { + "description": "Unauthorized" }, - "429" : { - "description" : "Too many requests" + "429": { + "description": "Too many requests" }, - "404" : { - "description" : "Not Found", - "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" + "422": { + "description": "Unable to process the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } } }, - "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" : { - "200" : { - "description" : "Ok", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BundleOption" + "responses": { + "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" + "401": { + "description": "Unauthorized" }, - "429" : { - "description" : "Too many requests" + "429": { + "description": "Too many requests" }, - "404" : { - "description" : "Not Found", - "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" + "422": { + "description": "Unable to process the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } } }, - "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" : { - "403" : { - "description" : "Forbidden" - }, - "500" : { - "description" : "Service unavailable", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "/info": { + "get": { + "tags": [ + "Home" + ], + "summary": "health check", + "description": "Return OK if application is started", + "operationId": "healthCheck", + "responses": { + "403": { + "description": "Forbidden" + }, + "500": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401" : { - "description" : "Unauthorized" + "401": { + "description": "Unauthorized" }, - "200" : { - "description" : "OK", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/AppInfo" + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AppInfo" } } } }, - "429" : { - "description" : "Too many requests" + "429": { + "description": "Too many requests" }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } } }, - "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" } } } @@ -470,28 +509,30 @@ } } }, - "/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" } } } @@ -499,28 +540,30 @@ } } }, - "/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" } } } @@ -528,28 +571,30 @@ } } }, - "/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" } } } @@ -558,365 +603,389 @@ } } }, - "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" } } }, - "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" } } }, - "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" } } }, - "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_v2.json b/openapi/openapi_v2.json index 5cb28dbc..99e24fad 100644 --- a/openapi/openapi_v2.json +++ b/openapi/openapi_v2.json @@ -1,481 +1,510 @@ { - "openapi" : "3.0.1", - "info" : { - "title" : "PagoPA API Calculator Logic", - "description" : "@project.description@", - "termsOfService" : "https://www.pagopa.gov.it/", - "version" : "@project.version@" + "openapi": "3.0.1", + "info": { + "title": "PagoPA API Calculator Logic", + "description": "@project.description@", + "termsOfService": "https://www.pagopa.gov.it/", + "version": "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" }, - "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/PaymentOptionByPsp" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentOptionByPsp" } } }, - "required" : true + "required": true }, - "responses" : { - "200" : { - "description" : "Ok", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BundleOption" + "responses": { + "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" + "401": { + "description": "Unauthorized" }, - "429" : { - "description" : "Too many requests" + "429": { + "description": "Too many requests" }, - "404" : { - "description" : "Not Found", - "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" + "422": { + "description": "Unable to process the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } } }, - "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/PaymentOption" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentOption" } } }, - "required" : true + "required": true }, - "responses" : { - "200" : { - "description" : "Ok", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BundleOption" + "responses": { + "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" + "401": { + "description": "Unauthorized" }, - "429" : { - "description" : "Too many requests" + "429": { + "description": "Too many requests" }, - "404" : { - "description" : "Not Found", - "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" + "422": { + "description": "Unable to process the request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } } }, - "security" : [ { - "ApiKey" : [ ] - } ] + "security": [ + { + "ApiKey": [] + } + ] } }, - "/info" : { - "get" : { - "tags" : [ "Home" ], - "summary" : "health check", - "description" : "Return OK if application is started", - "operationId" : "healthCheck", - "responses" : { - "403" : { - "description" : "Forbidden" - }, - "500" : { - "description" : "Service unavailable", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "/info": { + "get": { + "tags": [ + "Home" + ], + "summary": "health check", + "description": "Return OK if application is started", + "operationId": "healthCheck", + "responses": { + "403": { + "description": "Forbidden" + }, + "500": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401" : { - "description" : "Unauthorized" + "401": { + "description": "Unauthorized" }, - "200" : { - "description" : "OK", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/AppInfo" + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AppInfo" } } } }, - "429" : { - "description" : "Too many requests" + "429": { + "description": "Too many requests" }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } } }, - "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" } } }, - "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" } } }, - "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" } } }, - "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/pom.xml b/pom.xml index 11803f1f..e725fae0 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ it.gov.pagopa calculator - 2.10.3 + 2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2 afm-calculator Calculator Logic microservice for pagoPA AFM From d5ed230b2ca60629d71305966d2c690b7227da73 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:15:28 +0100 Subject: [PATCH 4/4] PAGOPA-1172 adding snippet to get description --- openapi/openapi_v1.json | 1571 ++++++++--------- openapi/openapi_v2.json | 769 ++++---- pom.xml | 7 + .../afm/calculator/OpenApiGenerationTest.java | 2 +- 4 files changed, 1162 insertions(+), 1187 deletions(-) diff --git a/openapi/openapi_v1.json b/openapi/openapi_v1.json index 30f59dca..62ee9e69 100644 --- a/openapi/openapi_v1.json +++ b/openapi/openapi_v1.json @@ -1,991 +1,988 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Calculator Logic", - "description": "@project.description@", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" + "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.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" }, - "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" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + } ], + "paths" : { + "/actuator" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator root web endpoint", + "operationId" : "links", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Link" + } + } } - } - } - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + }, + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Link" + } + } } - } - } - }, - "401": { - "description": "Unauthorized" - }, - "429": { - "description": "Too many requests" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + }, + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Link" + } + } } } } - }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + } + } + } + }, + "/actuator/health" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator web endpoint 'health'", + "operationId" : "health", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + }, + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object" } } } } - }, - "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" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "/actuator/health/**" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator web endpoint 'health-path'", + "operationId" : "health-path", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" } - } - } - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + }, + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object" } } } - }, - "401": { - "description": "Unauthorized" - }, - "429": { - "description": "Too many requests" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + } + } + } + }, + "/actuator/info" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator web endpoint 'info'", + "operationId" : "info", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object" } } } - }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + } + } + } + }, + "/actuator/metrics" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator web endpoint 'metrics'", + "operationId" : "metrics", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object" } } } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + } + } + } + }, + "/actuator/metrics/{requiredMetricName}" : { + "get" : { + "tags" : [ "Actuator" ], + "summary" : "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId" : "metrics-requiredMetricName", + "parameters" : [ { + "name" : "requiredMetricName", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" + } + }, + "application/vnd.spring-boot.actuator.v2+json" : { + "schema" : { + "type" : "object" + } + }, + "application/vnd.spring-boot.actuator.v3+json" : { + "schema" : { + "type" : "object" } } } } - }, - "security": [ - { - "ApiKey": [] - } - ] + } } }, - "/configuration/touchpoint/delete": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "deleteTouchpoints", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Touchpoint" + "/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" } } } }, - "/configuration/touchpoint/add": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "addTouchpoints", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Touchpoint" + "/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/paymenttypes/delete": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "deletePaymentTypes", - "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/paymenttypes/add": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "addPaymentTypes", - "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/bundles/delete": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "deleteValidBundles", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidBundle" + "/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/bundles/add": { - "post": { - "tags": [ - "Configuration" - ], - "operationId": "addValidBundles", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidBundle" + "/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" } } } }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "403": { - "description": "Forbidden" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } + "/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" } } }, - "401": { - "description": "Unauthorized" + "required" : true + }, + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } }, - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests" + "401" : { + "description" : "Unauthorized" }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - } - }, - "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" - } - } - } - }, - "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" - } - } + }, + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - } - } - } - }, - "/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/json": { - "schema": { - "type": "object" + }, + "429" : { + "description" : "Too many requests" + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } - } + }, + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/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" + "/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" } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object" + } + } + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } - }, - "application/json": { - "schema": { - "type": "object" + } + } + }, + "401" : { + "description" : "Unauthorized" + }, + "403" : { + "description" : "Forbidden" + }, + "429" : { + "description" : "Too many requests" + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } - } + }, + "security" : [ { + "ApiKey" : [ ] + } ] } }, - "/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/json": { - "schema": { - "type": "object" - } + "/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" } } - } - } - } - } - }, - "components": { - "schemas": { - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "idChannel": { - "type": "string" }, - "idBrokerPsp": { - "type": "string" + "required" : true + }, + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } }, - "paymentAmount": { - "type": "integer", - "format": "int64" + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } }, - "primaryCreditorInstitution": { - "type": "string" + "401" : { + "description" : "Unauthorized" }, - "paymentMethod": { - "type": "string" + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } }, - "touchpoint": { - "type": "string" + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } }, - "bin": { - "type": "string" + "429" : { + "description" : "Too many requests" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } } } - } - }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" + }, + "security" : [ { + "ApiKey" : [ ] + } ] + } + } + }, + "components" : { + "schemas" : { + "AppInfo" : { + "type" : "object", + "properties" : { + "environment" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "name" : { + "type" : "string" }, - "digitalStamp": { - "type": "boolean" + "version" : { + "type" : "string" } } }, - "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" - }, - "primaryCiIncurredFee": { - "type": "integer", - "format": "int64" + "CiBundle" : { + "type" : "object", + "properties" : { + "attributes" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CiBundleAttribute" + } }, - "paymentMethod": { - "type": "string" + "ciFiscalCode" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "id" : { + "type" : "string" + } + }, + "required" : [ "ciFiscalCode", "id" ] + }, + "CiBundleAttribute" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" }, - "idBundle": { - "type": "string" + "maxPaymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "bundleName": { - "type": "string" + "transferCategory" : { + "type" : "string" }, - "bundleDescription": { - "type": "string" + "transferCategoryRelation" : { + "type" : "string", + "enum" : [ "EQUAL", "NOT_EQUAL" ] + } + }, + "required" : [ "id" ] + }, + "Link" : { + "type" : "object", + "properties" : { + "href" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "templated" : { + "type" : "boolean" + } + } + }, + "PaymentOption" : { + "type" : "object", + "properties" : { + "bin" : { + "type" : "string" }, - "idPsp": { - "type": "string" + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" + } }, - "idChannel": { - "type": "string" + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "idBrokerPsp": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "onUs": { - "type": "boolean" + "primaryCreditorInstitution" : { + "type" : "string" }, - "abi": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "pspBusinessName": { - "type": "string" - } - } - }, - "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" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" + } } - } + }, + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ] }, - "PaymentOption": { - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ], - "type": "object", - "properties": { - "paymentAmount": { - "type": "integer", - "format": "int64" + "PaymentOptionByPsp" : { + "type" : "object", + "properties" : { + "bin" : { + "type" : "string" }, - "primaryCreditorInstitution": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "bin": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "paymentMethod": { - "type": "string" + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "touchpoint": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" - } + "primaryCreditorInstitution" : { + "type" : "string" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "touchpoint" : { + "type" : "string" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } } }, - "PspSearchCriteria": { - "required": [ - "idPsp" - ], - "type": "object", - "properties": { - "idPsp": { - "type": "string" + "PaymentType" : { + "type" : "object", + "properties" : { + "createdDate" : { + "type" : "string", + "format" : "date-time" }, - "idChannel": { - "type": "string" + "id" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "name" : { + "type" : "string" + } + }, + "required" : [ "id", "name" ] + }, + "ProblemJson" : { + "type" : "object", + "properties" : { + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" + }, + "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 + }, + "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" } } }, - "Touchpoint": { - "type": "object", - "properties": { - "id": { - "type": "string" + "PspSearchCriteria" : { + "type" : "object", + "properties" : { + "idBrokerPsp" : { + "type" : "string" }, - "name": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "creationDate": { - "type": "string", - "format": "date-time" + "idPsp" : { + "type" : "string" } - } + }, + "required" : [ "idPsp" ] }, - "PaymentType": { - "required": [ - "id", - "name" - ], - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "createdDate": { - "type": "string", - "format": "date-time" + "Touchpoint" : { + "type" : "object", + "properties" : { + "creationDate" : { + "type" : "string", + "format" : "date-time" + }, + "id" : { + "type" : "string" + }, + "name" : { + "type" : "string" } } }, - "CiBundle": { - "required": [ - "ciFiscalCode", - "id" - ], - "type": "object", - "properties": { - "id": { - "type": "string" + "Transfer" : { + "type" : "object", + "properties" : { + "abi" : { + "type" : "string" }, - "ciFiscalCode": { - "type": "string" + "bundleDescription" : { + "type" : "string" }, - "attributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundleAttribute" - } + "bundleName" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "idBundle" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "idCiBundle" : { + "type" : "string" + }, + "idPsp" : { + "type" : "string" + }, + "onUs" : { + "type" : "boolean" + }, + "paymentMethod" : { + "type" : "string" + }, + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" + }, + "pspBusinessName" : { + "type" : "string" + }, + "taxPayerFee" : { + "type" : "integer", + "format" : "int64" + }, + "touchpoint" : { + "type" : "string" } } }, - "CiBundleAttribute": { - "required": [ - "id" - ], - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "transferCategory": { - "type": "string" - }, - "transferCategoryRelation": { - "type": "string", - "enum": [ - "EQUAL", - "NOT_EQUAL" - ] + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" + }, + "digitalStamp" : { + "type" : "boolean" + }, + "transferCategory" : { + "type" : "string" } } }, - "ValidBundle": { - "required": [ - "digitalStamp", - "digitalStampRestriction" - ], - "type": "object", - "properties": { - "id": { - "type": "string" + "ValidBundle" : { + "type" : "object", + "properties" : { + "abi" : { + "type" : "string" }, - "idPsp": { - "type": "string" - }, - "abi": { - "type": "string" + "ciBundleList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CiBundle" + } }, - "pspBusinessName": { - "type": "string" + "description" : { + "type" : "string" }, - "name": { - "type": "string" + "digitalStamp" : { + "type" : "boolean" }, - "description": { - "type": "string" + "digitalStampRestriction" : { + "type" : "boolean" }, - "paymentAmount": { - "type": "integer", - "format": "int64" + "id" : { + "type" : "string" }, - "minPaymentAmount": { - "type": "integer", - "format": "int64" + "idBrokerPsp" : { + "type" : "string" }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" + "idChannel" : { + "type" : "string" }, - "paymentType": { - "type": "string" + "idPsp" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "maxPaymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "type": { - "type": "string", - "enum": [ - "GLOBAL", - "PUBLIC", - "PRIVATE" - ] + "minPaymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "transferCategoryList": { - "type": "array", - "items": { - "type": "string" - } + "name" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "onUs" : { + "type" : "boolean" }, - "idBrokerPsp": { - "type": "string" + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "digitalStamp": { - "type": "boolean" + "paymentType" : { + "type" : "string" }, - "digitalStampRestriction": { - "type": "boolean" + "pspBusinessName" : { + "type" : "string" }, - "onUs": { - "type": "boolean" + "touchpoint" : { + "type" : "string" }, - "ciBundleList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundle" + "transferCategoryList" : { + "type" : "array", + "items" : { + "type" : "string" } - } - } - }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" }, - "environment": { - "type": "string" + "type" : { + "type" : "string", + "enum" : [ "GLOBAL", "PUBLIC", "PRIVATE" ] } - } - }, - "Link": { - "type": "object", - "properties": { - "href": { - "type": "string" - }, - "templated": { - "type": "boolean" - } - } + }, + "required" : [ "digitalStamp", "digitalStampRestriction" ] } }, - "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 99e24fad..0e5e498a 100644 --- a/openapi/openapi_v2.json +++ b/openapi/openapi_v2.json @@ -1,510 +1,481 @@ { - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Calculator Logic", - "description": "@project.description@", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" + "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.3-1-PAGOPA-1172-sviluppo-carrello-multi-ente-definizione-interfacce-v-2" }, - "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" : { + "/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/PaymentOptionByPsp" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOption" } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } }, - "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" + "401" : { + "description" : "Unauthorized" }, - "429": { - "description": "Too many requests" - }, - "404": { - "description": "Not Found", - "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" + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "429" : { + "description" : "Too many requests" + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "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" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentOption" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" + "/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" } } } }, - "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" + "401" : { + "description" : "Unauthorized" }, - "429": { - "description": "Too many requests" + "403" : { + "description" : "Forbidden" }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "429" : { + "description" : "Too many requests" + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } + } + }, + "security" : [ { + "ApiKey" : [ ] + } ] + } + }, + "/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/PaymentOptionByPsp" + } + } }, - "422": { - "description": "Unable to process the request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "required" : true + }, + "responses" : { + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" } } } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - } - }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "403": { - "description": "Forbidden" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + }, + "401" : { + "description" : "Unauthorized" + }, + "404" : { + "description" : "Not Found", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized" - }, - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "422" : { + "description" : "Unable to process the request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests" + "429" : { + "description" : "Too many requests" }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] } } }, - "components": { - "schemas": { - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "idChannel": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "paymentAmount": { - "type": "integer", - "format": "int64" + "components" : { + "schemas" : { + "AppInfo" : { + "type" : "object", + "properties" : { + "environment" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "version" : { + "type" : "string" + } + } + }, + "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" + } + } + } + }, + "PaymentOption" : { + "type" : "object", + "properties" : { + "bin" : { + "type" : "string" + }, + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" + } }, - "primaryCreditorInstitution": { - "type": "string" + "paymentAmount" : { + "type" : "integer", + "format" : "int64" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "primaryCreditorInstitution" : { + "type" : "string" }, - "bin": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" } } - } + }, + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ] }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" + "PaymentOptionByPsp" : { + "type" : "object", + "properties" : { + "bin" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "idChannel" : { + "type" : "string" + }, + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "paymentMethod" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "primaryCreditorInstitution" : { + "type" : "string" }, - "digitalStamp": { - "type": "boolean" + "touchpoint" : { + "type" : "string" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" + } } } }, - "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" - } + "ProblemJson" : { + "type" : "object", + "properties" : { + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" + }, + "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 + }, + "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" } } }, - "Transfer": { - "type": "object", - "properties": { - "taxPayerFee": { - "type": "integer", - "format": "int64" + "PspSearchCriteria" : { + "type" : "object", + "properties" : { + "idBrokerPsp" : { + "type" : "string" }, - "primaryCiIncurredFee": { - "type": "integer", - "format": "int64" + "idChannel" : { + "type" : "string" }, - "paymentMethod": { - "type": "string" + "idPsp" : { + "type" : "string" + } + }, + "required" : [ "idPsp" ] + }, + "Transfer" : { + "type" : "object", + "properties" : { + "abi" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "bundleDescription" : { + "type" : "string" }, - "idBundle": { - "type": "string" + "bundleName" : { + "type" : "string" }, - "bundleName": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "bundleDescription": { - "type": "string" + "idBundle" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "idPsp": { - "type": "string" + "idCiBundle" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idPsp" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "onUs" : { + "type" : "boolean" }, - "onUs": { - "type": "boolean" + "paymentMethod" : { + "type" : "string" }, - "abi": { - "type": "string" + "primaryCiIncurredFee" : { + "type" : "integer", + "format" : "int64" }, - "pspBusinessName": { - "type": "string" - } - } - }, - "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" - } - } - }, - "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" - } + "pspBusinessName" : { + "type" : "string" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - } - }, - "PspSearchCriteria": { - "required": [ - "idPsp" - ], - "type": "object", - "properties": { - "idPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" + "taxPayerFee" : { + "type" : "integer", + "format" : "int64" + }, + "touchpoint" : { + "type" : "string" } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" }, - "version": { - "type": "string" + "digitalStamp" : { + "type" : "boolean" }, - "environment": { - "type": "string" + "transferCategory" : { + "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/pom.xml b/pom.xml index e725fae0..046c293b 100644 --- a/pom.xml +++ b/pom.xml @@ -176,6 +176,13 @@ + + + + src/test/resources + true + + org.springframework.boot diff --git a/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java b/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java index c30ce768..759dbe7e 100644 --- a/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java +++ b/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java @@ -30,7 +30,7 @@ class OpenApiGenerationTest { @Test void swaggerSpringPlugin() throws Exception { saveOpenAPI("/v3/api-docs/v1/", "openapi_v1.json"); - saveOpenAPI("/v3/api-docs/v2", "openapi_v2.json"); + saveOpenAPI("/v3/api-docs/v2/", "openapi_v2.json"); } private void saveOpenAPI(String fromUri, String toFile) throws Exception {