diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index 3f1ead5a..e5c12c45 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -84,7 +84,7 @@ jobs: - name: Check Size uses: actions/github-script@v6.3.3 env: - IGNORED_FILES: openapi.json, openapi-node.json + IGNORED_FILES: openapi-v1.json, openapi-v2.json, openapi-node-v1.json, openapi-node-v2.json with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/update_infra.yml b/.github/workflows/update_infra.yml index ba6b2805..ca6b03cf 100644 --- a/.github/workflows/update_infra.yml +++ b/.github/workflows/update_infra.yml @@ -6,8 +6,10 @@ on: - main types: [ closed ] paths: - - 'openapi/openapi.json' - - 'openapi/openapi-node.json' + - 'openapi/openapi-v1.json' + - 'openapi/openapi-v2.json' + - 'openapi/openapi-node-v1.json' + - 'openapi/openapi-node-v2.json' workflow_dispatch: diff --git a/.opex/internal/env/prod/config.yaml b/.opex/internal/env/prod/config.yaml index 48fb1394..18a0a74c 100644 --- a/.opex/internal/env/prod/config.yaml +++ b/.opex/internal/env/prod/config.yaml @@ -1,4 +1,4 @@ -oa3_spec: ./openapi/openapi.json # If start with http the file would be downloaded from the internet +oa3_spec: ./openapi/openapi-v1.json # If start with http the file would be downloaded from the internet name: opex_pagopa-afm-calculator location: West Europe timespan: 5m # Default, a number or a timespan https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/timespan diff --git a/.opex/node/env/prod/config.yaml b/.opex/node/env/prod/config.yaml index f2718de6..d063b2c5 100644 --- a/.opex/node/env/prod/config.yaml +++ b/.opex/node/env/prod/config.yaml @@ -1,4 +1,4 @@ -oa3_spec: ./openapi/openapi-node.json # If start with http the file would be downloaded from the internet +oa3_spec: ./openapi/openapi-node-v1.json # If start with http the file would be downloaded from the internet name: opex_pagopa-afm-calculator_node location: West Europe timespan: 5m # Default, a number or a timespan https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/timespan diff --git a/README.md b/README.md index 03a432e3..38b1808f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,11 @@ Spring Application exposes API to calculate taxpayer fees according to [_AFM Mar --- ## API Documentation 📖 -See the [OpenApi 3 here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi.json) +See the Openapi files at the following links: +- [OpenApi V1](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-v1.json) +- [OpenApi V2](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-v2.json) +- [OpenApi for Nodo dei pagamenti V1](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-node-v1.json) +- [OpenApi for Nodo dei pagamenti V2](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-node-v2.json) See the [OpenApi 3 here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-node.json) **for Nodo dei pagamenti** diff --git a/openapi/generate_openapi.sh b/openapi/generate_openapi.sh old mode 100644 new mode 100755 index 83032f85..228a14d0 --- a/openapi/generate_openapi.sh +++ b/openapi/generate_openapi.sh @@ -1,12 +1,7 @@ #!/bin/bash -# install api-spec-converter if not present -if [ $(npm list -g | grep -c api-spec-converter) -eq 0 ]; then - npm install -g api-spec-converter +if [[ "$(pwd)" =~ .*"openapi".* ]]; then + cd .. fi -# save openapi -curl http://localhost:8080/v3/api-docs | python3 -m json.tool > ./openapi.json -python3 generate_openapi_node.py ./openapi.json - -# UI mode http://localhost:8080/swagger-ui/index.html +mvn test -Dtest=OpenApiGenerationTest diff --git a/openapi/generate_openapi_node.py b/openapi/generate_openapi_node.py deleted file mode 100644 index 24e2cb27..00000000 --- a/openapi/generate_openapi_node.py +++ /dev/null @@ -1,22 +0,0 @@ -import json - -f = open('openapi.json') -data = json.load(f) - -filteredPath = {} -for path in data['paths']: - if '/configuration' not in path: - filteredPath.update({path: data['paths'][path]}) -data['paths'] = filteredPath - -filteredTags = [] -for tag in data['tags']: - if 'Configuration' != tag['name']: - filteredTags.append(tag) -data['tags'] = filteredTags - -data['info']['title'] = 'PagoPA API Calculator Logic for Node' - -with open('openapi-node.json', 'w') as f: - json.dump(data, f, indent=2) -f.close() diff --git a/openapi/generate_openapi_v1_v2.sh b/openapi/generate_openapi_v1_v2.sh deleted file mode 100644 index 228a14d0..00000000 --- a/openapi/generate_openapi_v1_v2.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [[ "$(pwd)" =~ .*"openapi".* ]]; then - cd .. -fi - -mvn test -Dtest=OpenApiGenerationTest diff --git a/openapi/openapi-node-v1.json b/openapi/openapi-node-v1.json new file mode 100644 index 00000000..b8edab34 --- /dev/null +++ b/openapi/openapi-node-v1.json @@ -0,0 +1,481 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "PagoPA API Calculator Logic", + "description" : "Calculator Logic microservice for pagoPA AFM", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "2.10.10" + }, + "servers" : [ { + "url" : "http://localhost/", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Calculator", + "description" : "Everything about Calculator business logic" + } ], + "paths" : { + "/psps/{idPsp}/fees" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of the specified idPSP", + "operationId" : "getFeesByPsp", + "parameters" : [ { + "name" : "idPsp", + "in" : "path", + "description" : "PSP identifier", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionByPsp" + } + } + }, + "required" : true + }, + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "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" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "404" : { + "description" : "Not Found", + "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" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "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" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "404" : { + "description" : "Not Found", + "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" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "403" : { + "description" : "Forbidden" + } + }, + "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" + } + } + }, + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 + }, + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" + } + } + }, + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + }, + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" + } + } + } + }, + "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" + } + } + }, + "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/openapi/openapi-node-v2.json b/openapi/openapi-node-v2.json new file mode 100644 index 00000000..4e2654a7 --- /dev/null +++ b/openapi/openapi-node-v2.json @@ -0,0 +1,491 @@ +{ + "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.10" + }, + "servers" : [ { + "url" : "http://localhost/", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Calculator", + "description" : "Everything about Calculator business logic" + } ], + "paths" : { + "/psps/{idPsp}/fees/multi" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of the specified idPSP with ECs contributions", + "operationId" : "getFeesByPspMulti", + "parameters" : [ { + "name" : "idPsp", + "in" : "path", + "description" : "PSP identifier", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionByPspMulti" + } + } + }, + "required" : true + }, + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "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" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "404" : { + "description" : "Not Found", + "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/PaymentOptionMulti" + } + } + }, + "required" : true + }, + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "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" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "404" : { + "description" : "Not Found", + "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" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "403" : { + "description" : "Forbidden" + } + }, + "security" : [ { + "ApiKey" : [ ] + } ] + } + } + }, + "components" : { + "schemas" : { + "PaymentNoticeItem" : { + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ], + "type" : "object", + "properties" : { + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "primaryCreditorInstitution" : { + "type" : "string" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" + } + } + } + }, + "PaymentOptionByPspMulti" : { + "required" : [ "paymentNotice" ], + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "bin" : { + "type" : "string" + }, + "paymentNotice" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNoticeItem" + } + } + } + }, + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" + }, + "transferCategory" : { + "type" : "string" + }, + "digitalStamp" : { + "type" : "boolean" + } + } + }, + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 + }, + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" + } + } + }, + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + }, + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" + } + } + } + }, + "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" + } + } + }, + "PaymentOptionMulti" : { + "required" : [ "paymentNotice" ], + "type" : "object", + "properties" : { + "bin" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" + } + }, + "paymentNotice" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNoticeItem" + } + }, + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "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/openapi/openapi-node.json b/openapi/openapi-node.json deleted file mode 100644 index 95131116..00000000 --- a/openapi/openapi-node.json +++ /dev/null @@ -1,854 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "PagoPA API Calculator Logic for Node", - "description": "Calculator Logic microservice for pagoPA AFM", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "2.10.10" - }, - "servers": [ - { - "url": "http://localhost:8080", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Calculator", - "description": "Everything about Calculator business logic" - } - ], - "paths": { - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" - } - } - } - }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "Not Found", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "422": { - "description": "Unable to process the request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "200": { - "description": "OK", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "403": { - "description": "Forbidden", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" - } - } - } - }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "Not Found", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "422": { - "description": "Unable to process the request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - } - }, - "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" - } - } - } - }, - "CiBundle": { - "type": "object", - "properties": { - "attributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundleAttribute" - } - }, - "ciFiscalCode": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "required": [ - "ciFiscalCode", - "id" - ] - }, - "CiBundleAttribute": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "transferCategory": { - "type": "string" - }, - "transferCategoryRelation": { - "type": "string", - "enum": [ - "EQUAL", - "NOT_EQUAL" - ] - } - }, - "required": [ - "id" - ] - }, - "PaymentOption": { - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" - } - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - }, - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ] - }, - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - } - }, - "PaymentType": { - "type": "object", - "properties": { - "createdDate": { - "type": "string", - "format": "date-time" - }, - "id": { - "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" - } - } - }, - "PspSearchCriteria": { - "type": "object", - "properties": { - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idPsp": { - "type": "string" - } - }, - "required": [ - "idPsp" - ] - }, - "Touchpoint": { - "type": "object", - "properties": { - "creationDate": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "Transfer": { - "type": "object", - "properties": { - "abi": { - "type": "string" - }, - "bundleDescription": { - "type": "string" - }, - "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" - }, - "taxPayerFee": { - "type": "integer", - "format": "int64" - }, - "touchpoint": { - "type": "string" - } - } - }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" - }, - "digitalStamp": { - "type": "boolean" - }, - "transferCategory": { - "type": "string" - } - } - }, - "ValidBundle": { - "type": "object", - "properties": { - "abi": { - "type": "string" - }, - "ciBundleList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundle" - } - }, - "description": { - "type": "string" - }, - "digitalStamp": { - "type": "boolean" - }, - "digitalStampRestriction": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idPsp": { - "type": "string" - }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "minPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "onUs": { - "type": "boolean" - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentType": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferCategoryList": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "enum": [ - "GLOBAL", - "PUBLIC", - "PRIVATE" - ] - } - }, - "required": [ - "digitalStamp", - "digitalStampRestriction" - ] - } - }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" - } - } - } -} diff --git a/openapi/openapi-v1.json b/openapi/openapi-v1.json new file mode 100644 index 00000000..ca77bb9b --- /dev/null +++ b/openapi/openapi-v1.json @@ -0,0 +1,922 @@ +{ + "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.10" + }, + "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" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "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" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "404" : { + "description" : "Not Found", + "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" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "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" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "404" : { + "description" : "Not Found", + "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" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "403" : { + "description" : "Forbidden" + } + }, + "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" + } + } + }, + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 + }, + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" + } + } + }, + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + }, + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" + } + } + } + }, + "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" + } + } + }, + "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..4e2654a7 --- /dev/null +++ b/openapi/openapi-v2.json @@ -0,0 +1,491 @@ +{ + "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.10" + }, + "servers" : [ { + "url" : "http://localhost/", + "description" : "Generated server url" + } ], + "tags" : [ { + "name" : "Calculator", + "description" : "Everything about Calculator business logic" + } ], + "paths" : { + "/psps/{idPsp}/fees/multi" : { + "post" : { + "tags" : [ "Calculator" ], + "summary" : "Get taxpayer fees of the specified idPSP with ECs contributions", + "operationId" : "getFeesByPspMulti", + "parameters" : [ { + "name" : "idPsp", + "in" : "path", + "description" : "PSP identifier", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "maxOccurrences", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "allCcp", + "in" : "query", + "description" : "Flag for the exclusion of Poste bundles: false -> excluded, true or null -> included", + "required" : false, + "schema" : { + "type" : "string", + "default" : "true" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PaymentOptionByPspMulti" + } + } + }, + "required" : true + }, + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "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" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "404" : { + "description" : "Not Found", + "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/PaymentOptionMulti" + } + } + }, + "required" : true + }, + "responses" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "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" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "Ok", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BundleOption" + } + } + } + }, + "404" : { + "description" : "Not Found", + "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" : { + "429" : { + "description" : "Too many requests" + }, + "401" : { + "description" : "Unauthorized" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" + } + } + } + }, + "500" : { + "description" : "Service unavailable", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } + } + }, + "403" : { + "description" : "Forbidden" + } + }, + "security" : [ { + "ApiKey" : [ ] + } ] + } + } + }, + "components" : { + "schemas" : { + "PaymentNoticeItem" : { + "required" : [ "paymentAmount", "primaryCreditorInstitution", "transferList" ], + "type" : "object", + "properties" : { + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + }, + "primaryCreditorInstitution" : { + "type" : "string" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferListItem" + } + } + } + }, + "PaymentOptionByPspMulti" : { + "required" : [ "paymentNotice" ], + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" + }, + "idBrokerPsp" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "bin" : { + "type" : "string" + }, + "paymentNotice" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNoticeItem" + } + } + } + }, + "TransferListItem" : { + "type" : "object", + "properties" : { + "creditorInstitution" : { + "type" : "string" + }, + "transferCategory" : { + "type" : "string" + }, + "digitalStamp" : { + "type" : "boolean" + } + } + }, + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 + }, + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" + } + } + }, + "BundleOption" : { + "type" : "object", + "properties" : { + "belowThreshold" : { + "type" : "boolean", + "description" : "if true (the payment amount is lower than the threshold value) the bundles onus is not calculated (always false)" + }, + "bundleOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" + } + } + } + }, + "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" + } + } + }, + "PaymentOptionMulti" : { + "required" : [ "paymentNotice" ], + "type" : "object", + "properties" : { + "bin" : { + "type" : "string" + }, + "paymentMethod" : { + "type" : "string" + }, + "touchpoint" : { + "type" : "string" + }, + "idPspList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PspSearchCriteria" + } + }, + "paymentNotice" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNoticeItem" + } + }, + "paymentAmount" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "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/openapi/openapi.json b/openapi/openapi.json deleted file mode 100644 index 996f8ed2..00000000 --- a/openapi/openapi.json +++ /dev/null @@ -1,1122 +0,0 @@ -{ - "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.10" - }, - "servers": [ - { - "url": "http://localhost:8080", - "description": "Generated server url" - } - ], - "tags": [ - { - "name": "Calculator", - "description": "Everything about Calculator business logic" - }, - { - "name": "Configuration", - "description": "Utility Services" - } - ], - "paths": { - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - } - } - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - } - } - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - } - } - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - } - } - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - } - } - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - } - } - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" - } - } - } - }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "Not Found", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "422": { - "description": "Unable to process the request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "200": { - "description": "OK", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "403": { - "description": "Forbidden", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - }, - "/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", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BundleOption" - } - } - } - }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "Not Found", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "422": { - "description": "Unable to process the request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } - } - ] - } - }, - "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" - } - } - } - }, - "CiBundle": { - "type": "object", - "properties": { - "attributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundleAttribute" - } - }, - "ciFiscalCode": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "required": [ - "ciFiscalCode", - "id" - ] - }, - "CiBundleAttribute": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "transferCategory": { - "type": "string" - }, - "transferCategoryRelation": { - "type": "string", - "enum": [ - "EQUAL", - "NOT_EQUAL" - ] - } - }, - "required": [ - "id" - ] - }, - "PaymentOption": { - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" - } - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - }, - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ] - }, - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - } - }, - "PaymentType": { - "type": "object", - "properties": { - "createdDate": { - "type": "string", - "format": "date-time" - }, - "id": { - "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" - } - } - }, - "PspSearchCriteria": { - "type": "object", - "properties": { - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idPsp": { - "type": "string" - } - }, - "required": [ - "idPsp" - ] - }, - "Touchpoint": { - "type": "object", - "properties": { - "creationDate": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "Transfer": { - "type": "object", - "properties": { - "abi": { - "type": "string" - }, - "bundleDescription": { - "type": "string" - }, - "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" - }, - "taxPayerFee": { - "type": "integer", - "format": "int64" - }, - "touchpoint": { - "type": "string" - } - } - }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" - }, - "digitalStamp": { - "type": "boolean" - }, - "transferCategory": { - "type": "string" - } - } - }, - "ValidBundle": { - "type": "object", - "properties": { - "abi": { - "type": "string" - }, - "ciBundleList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundle" - } - }, - "description": { - "type": "string" - }, - "digitalStamp": { - "type": "boolean" - }, - "digitalStampRestriction": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idPsp": { - "type": "string" - }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "minPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "onUs": { - "type": "boolean" - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentType": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferCategoryList": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "enum": [ - "GLOBAL", - "PUBLIC", - "PRIVATE" - ] - } - }, - "required": [ - "digitalStamp", - "digitalStampRestriction" - ] - } - }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" - } - } - } -} diff --git a/openapi/openapi_v1.json b/openapi/openapi_v1.json deleted file mode 100644 index 985ee04f..00000000 --- a/openapi/openapi_v1.json +++ /dev/null @@ -1,1063 +0,0 @@ -{ - "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.10" - }, - "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": { - "/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" - } - } - } - }, - "application/vnd.spring-boot.actuator.v2+json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - } - } - }, - "application/vnd.spring-boot.actuator.v3+json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - } - } - } - } - } - } - } - } - }, - "/actuator/health": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'health'", - "operationId": "health", - "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" - } - } - } - } - } - } - }, - "/actuator/health/**": { - "get": { - "tags": [ - "Actuator" - ], - "summary": "Actuator web endpoint 'health-path'", - "operationId": "health-path", - "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" - } - } - } - } - } - } - }, - "/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" - } - } - } - } - } - } - }, - "/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" - } - } - } - } - } - } - }, - "/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" - } - } - } - } - } - } - }, - "/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" - } - } - } - }, - "/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/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/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/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/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" - } - } - } - }, - "/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" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized" - }, - "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" - } - } - } - }, - "429": { - "description": "Too many requests" - }, - "500": { - "description": "Service unavailable", - "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": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "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": [] - } - ] - } - }, - "/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" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized" - }, - "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" - } - } - } - }, - "429": { - "description": "Too many requests" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - } - } - }, - "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" - } - } - } - }, - "CiBundle": { - "type": "object", - "properties": { - "attributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundleAttribute" - } - }, - "ciFiscalCode": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "required": [ - "ciFiscalCode", - "id" - ] - }, - "CiBundleAttribute": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "transferCategory": { - "type": "string" - }, - "transferCategoryRelation": { - "type": "string", - "enum": [ - "EQUAL", - "NOT_EQUAL" - ] - } - }, - "required": [ - "id" - ] - }, - "Link": { - "type": "object", - "properties": { - "href": { - "type": "string" - }, - "templated": { - "type": "boolean" - } - } - }, - "PaymentOption": { - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "idPspList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PspSearchCriteria" - } - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - }, - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ] - }, - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - } - }, - "PaymentType": { - "type": "object", - "properties": { - "createdDate": { - "type": "string", - "format": "date-time" - }, - "id": { - "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" - } - } - }, - "PspSearchCriteria": { - "type": "object", - "properties": { - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idPsp": { - "type": "string" - } - }, - "required": [ - "idPsp" - ] - }, - "Touchpoint": { - "type": "object", - "properties": { - "creationDate": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "Transfer": { - "type": "object", - "properties": { - "abi": { - "type": "string" - }, - "bundleDescription": { - "type": "string" - }, - "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" - } - } - }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" - }, - "digitalStamp": { - "type": "boolean" - }, - "transferCategory": { - "type": "string" - } - } - }, - "ValidBundle": { - "type": "object", - "properties": { - "abi": { - "type": "string" - }, - "ciBundleList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CiBundle" - } - }, - "description": { - "type": "string" - }, - "digitalStamp": { - "type": "boolean" - }, - "digitalStampRestriction": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idPsp": { - "type": "string" - }, - "maxPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "minPaymentAmount": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "onUs": { - "type": "boolean" - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentType": { - "type": "string" - }, - "pspBusinessName": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferCategoryList": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "enum": [ - "GLOBAL", - "PUBLIC", - "PRIVATE" - ] - } - }, - "required": [ - "digitalStamp", - "digitalStampRestriction" - ] - } - }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" - } - } - } -} diff --git a/openapi/openapi_v2.json b/openapi/openapi_v2.json deleted file mode 100644 index 37e0aa67..00000000 --- a/openapi/openapi_v2.json +++ /dev/null @@ -1,510 +0,0 @@ -{ - "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.10" - }, - "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/PaymentOption" - } - } - }, - "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" - } - } - } - }, - "401": { - "description": "Unauthorized" - }, - "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" - } - } - } - }, - "429": { - "description": "Too many requests" - }, - "500": { - "description": "Service unavailable", - "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": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "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": [] - } - ] - } - }, - "/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" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "401": { - "description": "Unauthorized" - }, - "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" - } - } - } - }, - "429": { - "description": "Too many requests" - }, - "500": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - } - }, - "security": [ - { - "ApiKey": [] - } - ] - } - } - }, - "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" - } - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - }, - "required": [ - "paymentAmount", - "primaryCreditorInstitution", - "transferList" - ] - }, - "PaymentOptionByPsp": { - "type": "object", - "properties": { - "bin": { - "type": "string" - }, - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "paymentAmount": { - "type": "integer", - "format": "int64" - }, - "paymentMethod": { - "type": "string" - }, - "primaryCreditorInstitution": { - "type": "string" - }, - "touchpoint": { - "type": "string" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferListItem" - } - } - } - }, - "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" - } - } - }, - "PspSearchCriteria": { - "type": "object", - "properties": { - "idBrokerPsp": { - "type": "string" - }, - "idChannel": { - "type": "string" - }, - "idPsp": { - "type": "string" - } - }, - "required": [ - "idPsp" - ] - }, - "Transfer": { - "type": "object", - "properties": { - "abi": { - "type": "string" - }, - "bundleDescription": { - "type": "string" - }, - "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" - } - } - }, - "TransferListItem": { - "type": "object", - "properties": { - "creditorInstitution": { - "type": "string" - }, - "digitalStamp": { - "type": "boolean" - }, - "transferCategory": { - "type": "string" - } - } - } - }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" - } - } - } -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 55745ec4..0e92d194 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -22,6 +22,12 @@ 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 +springdoc.group-configs[2].group=node_v1 +springdoc.group-configs[2].displayName=API AFM-Calculator for node v1 +springdoc.group-configs[2].paths-to-match=/**/fees,/info +springdoc.group-configs[3].group=node_v2 +springdoc.group-configs[3].displayName=API AFM-Calculator for node v2 +springdoc.group-configs[3].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 index 759dbe7e..3030b466 100644 --- a/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java +++ b/src/test/java/it/gov/pagopa/afm/calculator/OpenApiGenerationTest.java @@ -29,8 +29,10 @@ 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/v1/", "openapi-v1.json"); + saveOpenAPI("/v3/api-docs/v2/", "openapi-v2.json"); + saveOpenAPI("/v3/api-docs/node_v1/", "openapi-node-v1.json"); + saveOpenAPI("/v3/api-docs/node_v2/", "openapi-node-v2.json"); } private void saveOpenAPI(String fromUri, String toFile) throws Exception { diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 04804de0..81e6d75a 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -56,3 +56,9 @@ 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 +springdoc.group-configs[2].group=node_v1 +springdoc.group-configs[2].displayName=API AFM-Calculator for node v1 +springdoc.group-configs[2].paths-to-match=/**/fees,/info +springdoc.group-configs[3].group=node_v2 +springdoc.group-configs[3].displayName=API AFM-Calculator for node v2 +springdoc.group-configs[3].paths-to-match=/**/multi,/info