From 739a80f84be7e78ea3b6b205d0a52f56364fda06 Mon Sep 17 00:00:00 2001 From: alessio-acitelli <97529051+alessio-acitelli@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:15:14 +0200 Subject: [PATCH] feat: [Pagopa-1799] - add filter (#77) * [PAGOPA-1799] add filter: added filter to cached list * [PAGOPA-1799] add filter: update openapi * [PAGOPA-1799] add filter: fix issue * fi --------- Co-authored-by: pagopa-github-bot Co-authored-by: aacitelli Co-authored-by: pasqualespica <36746022+pasqualespica@users.noreply.github.com> --- helm/values-prod.yaml | 8 +- openapi/openapi.json | 3279 ++++++++--------- openapi/openapi_ec.json | 1073 +++--- openapi/openapi_helpdesk.json | 1436 ++++---- openapi/openapi_io.json | 1554 ++++---- openapi/openapi_io_patch.json | 153 +- .../controller/ITransactionController.java | 27 +- .../impl/TransactionController.java | 19 +- .../bizeventsservice/exception/AppError.java | 3 +- .../model/filterandorder/Order.java | 3 +- .../BizEventsViewUserRepository.java | 11 +- .../service/ITransactionService.java | 7 +- .../service/impl/TransactionService.java | 31 +- .../pagopa/bizeventsservice/util/Util.java | 35 +- .../controller/TransactionControllerTest.java | 8 +- .../service/TransactionServiceTest.java | 105 +- .../bizeventsservice/util/UtilTest.java | 6 - 17 files changed, 3875 insertions(+), 3883 deletions(-) diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index a4b55a60..4b2d2871 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -53,14 +53,14 @@ microservice-chart: resources: requests: memory: "512Mi" - cpu: "300m" + cpu: "400m" limits: - memory: "640Mi" - cpu: "500m" + memory: "1512Mi" + cpu: "800m" autoscaling: enable: true minReplica: 2 - maxReplica: 10 + maxReplica: 6 pollingInterval: 10 # seconds cooldownPeriod: 50 # seconds triggers: diff --git a/openapi/openapi.json b/openapi/openapi.json index 2e0a0110..f0b07d12 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -1,2338 +1,2261 @@ { - "openapi": "3.0.1", - "info": { - "title": "Biz-Events Service", - "description": "Microservice for exposing REST APIs about payment receipts.", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.1.41" + "openapi" : "3.0.1", + "info" : { + "title" : "Biz-Events Service", + "description" : "Microservice for exposing REST APIs about payment receipts.", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "0.1.41" }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/events/organizations/{organization-fiscal-code}/iuvs/{iuv}": { - "get": { - "tags": [ - "Biz-Events Helpdesk" - ], - "summary": "Retrieve the biz-event given the organization fiscal code and IUV.", - "operationId": "getBizEventByOrganizationFiscalCodeAndIuv", - "parameters": [ - { - "name": "organization-fiscal-code", - "in": "path", - "description": "The fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iuv", - "in": "path", - "description": "The unique payment identification. Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained biz-event.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "servers" : [ { + "url" : "http://localhost", + "description" : "Generated server url" + } ], + "paths" : { + "/events/organizations/{organization-fiscal-code}/iuvs/{iuv}" : { + "get" : { + "tags" : [ "Biz-Events Helpdesk" ], + "summary" : "Retrieve the biz-event given the organization fiscal code and IUV.", + "operationId" : "getBizEventByOrganizationFiscalCodeAndIuv", + "parameters" : [ { + "name" : "organization-fiscal-code", + "in" : "path", + "description" : "The fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iuv", + "in" : "path", + "description" : "The unique payment identification. Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Obtained biz-event.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BizEvent" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BizEvent" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the biz-event.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the biz-event.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "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" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/events/{biz-event-id}": { - "get": { - "tags": [ - "Biz-Events Helpdesk" - ], - "summary": "Retrieve the biz-event given its id.", - "operationId": "getBizEvent", - "parameters": [ - { - "name": "biz-event-id", - "in": "path", - "description": "The id of the biz-event.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained biz-event.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/events/{biz-event-id}" : { + "get" : { + "tags" : [ "Biz-Events Helpdesk" ], + "summary" : "Retrieve the biz-event given its id.", + "operationId" : "getBizEvent", + "parameters" : [ { + "name" : "biz-event-id", + "in" : "path", + "description" : "The id of the biz-event.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Obtained biz-event.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BizEvent" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BizEvent" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the biz-event.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the biz-event.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "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" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "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" + "/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" + "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" + "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" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "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" + "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" + "500" : { + "description" : "Service unavailable", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/organizations/{organizationfiscalcode}/receipts/{iur}": { - "get": { - "tags": [ - "Payment Receipts REST APIs" - ], - "summary": "The organization get the receipt for the creditor institution using IUR.", - "operationId": "getOrganizationReceiptIur", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "The fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iur", - "in": "path", - "description": "The unique reference of the operation assigned to the payment (Payment Token).", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/organizations/{organizationfiscalcode}/receipts/{iur}" : { + "get" : { + "tags" : [ "Payment Receipts REST APIs" ], + "summary" : "The organization get the receipt for the creditor institution using IUR.", + "operationId" : "getOrganizationReceiptIur", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "The fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iur", + "in" : "path", + "description" : "The unique reference of the operation assigned to the payment (Payment Token).", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Obtained receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CtReceiptModelResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CtReceiptModelResponse" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "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" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/organizations/{organizationfiscalcode}/receipts/{iur}/paymentoptions/{iuv}": { - "get": { - "tags": [ - "Payment Receipts REST APIs" - ], - "summary": "The organization get the receipt for the creditor institution using IUV and IUR.", - "operationId": "getOrganizationReceiptIuvIur", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "The fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iur", - "in": "path", - "description": "The unique reference of the operation assigned to the payment (Payment Token).", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iuv", - "in": "path", - "description": "The unique payment identification. Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/organizations/{organizationfiscalcode}/receipts/{iur}/paymentoptions/{iuv}" : { + "get" : { + "tags" : [ "Payment Receipts REST APIs" ], + "summary" : "The organization get the receipt for the creditor institution using IUV and IUR.", + "operationId" : "getOrganizationReceiptIuvIur", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "The fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iur", + "in" : "path", + "description" : "The unique reference of the operation assigned to the payment (Payment Token).", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iuv", + "in" : "path", + "description" : "The unique payment identification. Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Obtained receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CtReceiptModelResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CtReceiptModelResponse" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "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" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions": { - "get": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Retrieve the paged transaction list from biz events.", - "operationId": "getTransactionList", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "x-continuation-token", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - } - ], - "responses": { - "200": { - "description": "Obtained transaction list.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions" : { + "get" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Retrieve the paged transaction list from biz events.", + "operationId" : "getTransactionList", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "is_payer", + "in" : "query", + "description" : "Filter by payer", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "is_debtor", + "in" : "query", + "description" : "Filter by debtor", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "x-continuation-token", + "in" : "header", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "size", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "orderby", + "in" : "query", + "description" : "Order by TRANSACTION_DATE", + "required" : false, + "schema" : { + "type" : "string", + "default" : "TRANSACTION_DATE", + "enum" : [ "TRANSACTION_DATE" ] + } + }, { + "name" : "ordering", + "in" : "query", + "description" : "Direction of ordering", + "required" : false, + "schema" : { + "type" : "string", + "default" : "DESC", + "enum" : [ "ASC", "DESC" ] + } + } ], + "responses" : { + "200" : { + "description" : "Obtained transaction list.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } }, - "x-continuation-token": { - "description": "continuation token for paginated query", - "style": "simple", - "schema": { - "type": "string" + "x-continuation-token" : { + "description" : "continuation token for paginated query", + "style" : "simple", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionListWrapResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TransactionListWrapResponse" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the transaction.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the transaction.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests.", - "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions/cached": { - "get": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Retrieve the paged transaction list from biz events.", - "operationId": "getTransactionList_1", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - } - ], - "responses": { - "200": { - "description": "Obtained transaction list.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions/cached" : { + "get" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Retrieve the paged transaction list from biz events.", + "operationId" : "getTransactionList_1", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "is_payer", + "in" : "query", + "description" : "Filter by payer", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "is_debtor", + "in" : "query", + "description" : "Filter by debtor", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "page", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 0 + } + }, { + "name" : "size", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "orderby", + "in" : "query", + "description" : "Order by TRANSACTION_DATE", + "required" : false, + "schema" : { + "type" : "string", + "default" : "TRANSACTION_DATE", + "enum" : [ "TRANSACTION_DATE" ] + } + }, { + "name" : "ordering", + "in" : "query", + "description" : "Direction of ordering", + "required" : false, + "schema" : { + "type" : "string", + "default" : "DESC", + "enum" : [ "ASC", "DESC" ] + } + } ], + "responses" : { + "200" : { + "description" : "Obtained transaction list.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionListWrapResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TransactionListWrapResponse" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the transaction.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the transaction.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions/{event-id}/pdf": { - "get": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Retrieve the PDF receipt given event id.", - "operationId": "getPDFReceipt", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "event-id", - "in": "path", - "description": "The id of the event.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained the PDF receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions/{event-id}/pdf" : { + "get" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Retrieve the PDF receipt given event id.", + "operationId" : "getPDFReceipt", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "event-id", + "in" : "path", + "description" : "The id of the event.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Obtained the PDF receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/pdf": { - "schema": { - "type": "string", - "format": "binary" + "content" : { + "application/pdf" : { + "schema" : { + "type" : "string", + "format" : "binary" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unprocessable receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "422" : { + "description" : "Unprocessable receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions/{transaction-id}": { - "get": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Retrieve the transaction details given its id.", - "operationId": "getTransactionDetails", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "transaction-id", - "in": "path", - "description": "The id of the transaction.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained transaction details.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions/{transaction-id}" : { + "get" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Retrieve the transaction details given its id.", + "operationId" : "getTransactionDetails", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "transaction-id", + "in" : "path", + "description" : "The id of the transaction.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Obtained transaction details.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionDetailResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TransactionDetailResponse" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the transaction.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the transaction.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions/{transaction-id}/disable": { - "post": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Disable the transaction details given its id.", - "operationId": "disableTransaction", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "transaction-id", - "in": "path", - "description": "The id of the transaction.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Disabled Transactions.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions/{transaction-id}/disable" : { + "post" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Disable the transaction details given its id.", + "operationId" : "disableTransaction", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "transaction-id", + "in" : "path", + "description" : "The id of the transaction.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Disabled Transactions.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": {} + "content" : { + "application/json" : { } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the transaction.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the transaction.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] } }, - "components": { - "schemas": { - "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" + "components" : { + "schemas" : { + "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" } } }, - "PageInfo": { - "required": [ - "items_found", - "limit", - "page", - "total_pages" - ], - "type": "object", - "properties": { - "page": { - "type": "integer", - "description": "Page number", - "format": "int32" - }, - "limit": { - "type": "integer", - "description": "Required number of items per page", - "format": "int32" - }, - "items_found": { - "type": "integer", - "description": "Number of items found. (The last page may have fewer elements than required)", - "format": "int32" - }, - "total_pages": { - "type": "integer", - "description": "Total number of pages", - "format": "int32" + "PageInfo" : { + "required" : [ "items_found", "limit", "page", "total_pages" ], + "type" : "object", + "properties" : { + "page" : { + "type" : "integer", + "description" : "Page number", + "format" : "int32" + }, + "limit" : { + "type" : "integer", + "description" : "Required number of items per page", + "format" : "int32" + }, + "items_found" : { + "type" : "integer", + "description" : "Number of items found. (The last page may have fewer elements than required)", + "format" : "int32" + }, + "total_pages" : { + "type" : "integer", + "description" : "Total number of pages", + "format" : "int32" } } }, - "TransactionListItem": { - "type": "object", - "properties": { - "transactionId": { - "type": "string" + "TransactionListItem" : { + "type" : "object", + "properties" : { + "transactionId" : { + "type" : "string" }, - "payeeName": { - "type": "string" + "payeeName" : { + "type" : "string" }, - "payeeTaxCode": { - "type": "string" + "payeeTaxCode" : { + "type" : "string" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "transactionDate": { - "type": "string" + "transactionDate" : { + "type" : "string" }, - "isCart": { - "type": "boolean" + "isCart" : { + "type" : "boolean" }, - "isPayer": { - "type": "boolean" + "isPayer" : { + "type" : "boolean" }, - "isDebtor": { - "type": "boolean" + "isDebtor" : { + "type" : "boolean" } } }, - "TransactionListWrapResponse": { - "type": "object", - "properties": { - "transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransactionListItem" + "TransactionListWrapResponse" : { + "type" : "object", + "properties" : { + "transactions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransactionListItem" } }, - "page_info": { - "$ref": "#/components/schemas/PageInfo" + "page_info" : { + "$ref" : "#/components/schemas/PageInfo" } } }, - "CartItem": { - "type": "object", - "properties": { - "subject": { - "type": "string" + "CartItem" : { + "type" : "object", + "properties" : { + "subject" : { + "type" : "string" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "payee": { - "$ref": "#/components/schemas/UserDetail" + "payee" : { + "$ref" : "#/components/schemas/UserDetail" }, - "debtor": { - "$ref": "#/components/schemas/UserDetail" + "debtor" : { + "$ref" : "#/components/schemas/UserDetail" }, - "refNumberValue": { - "type": "string" + "refNumberValue" : { + "type" : "string" }, - "refNumberType": { - "type": "string" + "refNumberType" : { + "type" : "string" } } }, - "InfoTransactionView": { - "type": "object", - "properties": { - "transactionId": { - "type": "string" - }, - "authCode": { - "type": "string" - }, - "rrn": { - "type": "string" - }, - "transactionDate": { - "type": "string" - }, - "pspName": { - "type": "string" - }, - "walletInfo": { - "$ref": "#/components/schemas/WalletInfo" - }, - "paymentMethod": { - "type": "string", - "enum": [ - "BBT", - "BP", - "AD", - "CP", - "PO", - "OBEP", - "JIF", - "MYBK", - "PPAL", - "UNKNOWN" - ] - }, - "payer": { - "$ref": "#/components/schemas/UserDetail" - }, - "amount": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "origin": { - "type": "string", - "enum": [ - "INTERNAL", - "PM", - "NDP001PROD", - "NDP002PROD", - "NDP003PROD", - "UNKNOWN" - ] + "InfoTransactionView" : { + "type" : "object", + "properties" : { + "transactionId" : { + "type" : "string" + }, + "authCode" : { + "type" : "string" + }, + "rrn" : { + "type" : "string" + }, + "transactionDate" : { + "type" : "string" + }, + "pspName" : { + "type" : "string" + }, + "walletInfo" : { + "$ref" : "#/components/schemas/WalletInfo" + }, + "paymentMethod" : { + "type" : "string", + "enum" : [ "BBT", "BP", "AD", "CP", "PO", "OBEP", "JIF", "MYBK", "PPAL", "UNKNOWN" ] + }, + "payer" : { + "$ref" : "#/components/schemas/UserDetail" + }, + "amount" : { + "type" : "string" + }, + "fee" : { + "type" : "string" + }, + "origin" : { + "type" : "string", + "enum" : [ "INTERNAL", "PM", "NDP001PROD", "NDP002PROD", "NDP003PROD", "UNKNOWN" ] } } }, - "TransactionDetailResponse": { - "type": "object", - "properties": { - "infoTransaction": { - "$ref": "#/components/schemas/InfoTransactionView" + "TransactionDetailResponse" : { + "type" : "object", + "properties" : { + "infoTransaction" : { + "$ref" : "#/components/schemas/InfoTransactionView" }, - "carts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CartItem" + "carts" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CartItem" } } } }, - "UserDetail": { - "type": "object", - "properties": { - "name": { - "type": "string" + "UserDetail" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "taxCode": { - "type": "string" + "taxCode" : { + "type" : "string" } } }, - "WalletInfo": { - "type": "object", - "properties": { - "accountHolder": { - "type": "string" + "WalletInfo" : { + "type" : "object", + "properties" : { + "accountHolder" : { + "type" : "string" }, - "brand": { - "type": "string" + "brand" : { + "type" : "string" }, - "blurredNumber": { - "type": "string" + "blurredNumber" : { + "type" : "string" }, - "maskedEmail": { - "type": "string" + "maskedEmail" : { + "type" : "string" } } }, - "CtReceiptModelResponse": { - "required": [ - "channelDescription", - "companyName", - "creditorReferenceId", - "debtor", - "description", - "fiscalCode", - "idChannel", - "idPSP", - "noticeNumber", - "outcome", - "paymentAmount", - "pspCompanyName", - "receiptId", - "transferList" - ], - "type": "object", - "properties": { - "receiptId": { - "type": "string" + "CtReceiptModelResponse" : { + "required" : [ "channelDescription", "companyName", "creditorReferenceId", "debtor", "description", "fiscalCode", "idChannel", "idPSP", "noticeNumber", "outcome", "paymentAmount", "pspCompanyName", "receiptId", "transferList" ], + "type" : "object", + "properties" : { + "receiptId" : { + "type" : "string" }, - "noticeNumber": { - "type": "string" + "noticeNumber" : { + "type" : "string" }, - "fiscalCode": { - "type": "string" + "fiscalCode" : { + "type" : "string" }, - "outcome": { - "type": "string" + "outcome" : { + "type" : "string" }, - "creditorReferenceId": { - "type": "string" + "creditorReferenceId" : { + "type" : "string" }, - "paymentAmount": { - "type": "number" + "paymentAmount" : { + "type" : "number" }, - "description": { - "type": "string" + "description" : { + "type" : "string" }, - "companyName": { - "type": "string" + "companyName" : { + "type" : "string" }, - "officeName": { - "type": "string" + "officeName" : { + "type" : "string" }, - "debtor": { - "$ref": "#/components/schemas/Debtor" + "debtor" : { + "$ref" : "#/components/schemas/Debtor" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferPA" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferPA" } }, - "idPSP": { - "type": "string" + "idPSP" : { + "type" : "string" }, - "pspFiscalCode": { - "type": "string" + "pspFiscalCode" : { + "type" : "string" }, - "pspPartitaIVA": { - "type": "string" + "pspPartitaIVA" : { + "type" : "string" }, - "pspCompanyName": { - "type": "string" + "pspCompanyName" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "channelDescription": { - "type": "string" + "channelDescription" : { + "type" : "string" }, - "payer": { - "$ref": "#/components/schemas/Payer" + "payer" : { + "$ref" : "#/components/schemas/Payer" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "fee": { - "type": "number" + "fee" : { + "type" : "number" }, - "primaryCiIncurredFee": { - "type": "number" + "primaryCiIncurredFee" : { + "type" : "number" }, - "idBundle": { - "type": "string" + "idBundle" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "idCiBundle" : { + "type" : "string" }, - "paymentDateTime": { - "type": "string", - "format": "date" + "paymentDateTime" : { + "type" : "string", + "format" : "date" }, - "applicationDate": { - "type": "string", - "format": "date" + "applicationDate" : { + "type" : "string", + "format" : "date" }, - "transferDate": { - "type": "string", - "format": "date" + "transferDate" : { + "type" : "string", + "format" : "date" }, - "metadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MapEntry" + "metadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/MapEntry" } } } }, - "Debtor": { - "type": "object", - "properties": { - "fullName": { - "type": "string" + "Debtor" : { + "type" : "object", + "properties" : { + "fullName" : { + "type" : "string" }, - "entityUniqueIdentifierType": { - "type": "string" + "entityUniqueIdentifierType" : { + "type" : "string" }, - "entityUniqueIdentifierValue": { - "type": "string" + "entityUniqueIdentifierValue" : { + "type" : "string" }, - "streetName": { - "type": "string" + "streetName" : { + "type" : "string" }, - "civicNumber": { - "type": "string" + "civicNumber" : { + "type" : "string" }, - "postalCode": { - "type": "string" + "postalCode" : { + "type" : "string" }, - "city": { - "type": "string" + "city" : { + "type" : "string" }, - "stateProvinceRegion": { - "type": "string" + "stateProvinceRegion" : { + "type" : "string" }, - "country": { - "type": "string" + "country" : { + "type" : "string" }, - "eMail": { - "type": "string" + "eMail" : { + "type" : "string" } } }, - "MapEntry": { - "type": "object", - "properties": { - "key": { - "type": "string" + "MapEntry" : { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" }, - "value": { - "type": "string" + "value" : { + "type" : "string" } } }, - "Payer": { - "type": "object", - "properties": { - "fullName": { - "type": "string" + "Payer" : { + "type" : "object", + "properties" : { + "fullName" : { + "type" : "string" }, - "entityUniqueIdentifierType": { - "type": "string" + "entityUniqueIdentifierType" : { + "type" : "string" }, - "entityUniqueIdentifierValue": { - "type": "string" + "entityUniqueIdentifierValue" : { + "type" : "string" }, - "streetName": { - "type": "string" + "streetName" : { + "type" : "string" }, - "civicNumber": { - "type": "string" + "civicNumber" : { + "type" : "string" }, - "postalCode": { - "type": "string" + "postalCode" : { + "type" : "string" }, - "city": { - "type": "string" + "city" : { + "type" : "string" }, - "stateProvinceRegion": { - "type": "string" + "stateProvinceRegion" : { + "type" : "string" }, - "country": { - "type": "string" + "country" : { + "type" : "string" }, - "eMail": { - "type": "string" + "eMail" : { + "type" : "string" } } }, - "TransferPA": { - "required": [ - "fiscalCodePA", - "iban", - "mbdAttachment", - "remittanceInformation", - "transferAmount", - "transferCategory" - ], - "type": "object", - "properties": { - "idTransfer": { - "maximum": 5, - "minimum": 1, - "type": "integer", - "format": "int32" - }, - "transferAmount": { - "type": "number" - }, - "fiscalCodePA": { - "type": "string" - }, - "iban": { - "type": "string" - }, - "mbdAttachment": { - "type": "string" - }, - "remittanceInformation": { - "type": "string" - }, - "transferCategory": { - "type": "string" - }, - "metadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MapEntry" + "TransferPA" : { + "required" : [ "fiscalCodePA", "iban", "mbdAttachment", "remittanceInformation", "transferAmount", "transferCategory" ], + "type" : "object", + "properties" : { + "idTransfer" : { + "maximum" : 5, + "minimum" : 1, + "type" : "integer", + "format" : "int32" + }, + "transferAmount" : { + "type" : "number" + }, + "fiscalCodePA" : { + "type" : "string" + }, + "iban" : { + "type" : "string" + }, + "mbdAttachment" : { + "type" : "string" + }, + "remittanceInformation" : { + "type" : "string" + }, + "transferCategory" : { + "type" : "string" + }, + "metadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/MapEntry" } } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } }, - "AuthRequest": { - "type": "object", - "properties": { - "authOutcome": { - "type": "string" + "AuthRequest" : { + "type" : "object", + "properties" : { + "authOutcome" : { + "type" : "string" }, - "guid": { - "type": "string" + "guid" : { + "type" : "string" }, - "correlationId": { - "type": "string" + "correlationId" : { + "type" : "string" }, - "error": { - "type": "string" + "error" : { + "type" : "string" }, - "auth_code": { - "type": "string" + "auth_code" : { + "type" : "string" } } }, - "BizEvent": { - "type": "object", - "properties": { - "id": { - "type": "string" + "BizEvent" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "idPaymentManager": { - "type": "string" + "idPaymentManager" : { + "type" : "string" }, - "complete": { - "type": "string" + "complete" : { + "type" : "string" }, - "receiptId": { - "type": "string" + "receiptId" : { + "type" : "string" }, - "missingInfo": { - "type": "array", - "items": { - "type": "string" + "missingInfo" : { + "type" : "array", + "items" : { + "type" : "string" } }, - "debtorPosition": { - "$ref": "#/components/schemas/DebtorPosition" + "debtorPosition" : { + "$ref" : "#/components/schemas/DebtorPosition" }, - "creditor": { - "$ref": "#/components/schemas/Creditor" + "creditor" : { + "$ref" : "#/components/schemas/Creditor" }, - "psp": { - "$ref": "#/components/schemas/Psp" + "psp" : { + "$ref" : "#/components/schemas/Psp" }, - "debtor": { - "$ref": "#/components/schemas/Debtor" + "debtor" : { + "$ref" : "#/components/schemas/Debtor" }, - "payer": { - "$ref": "#/components/schemas/Payer" + "payer" : { + "$ref" : "#/components/schemas/Payer" }, - "paymentInfo": { - "$ref": "#/components/schemas/PaymentInfo" + "paymentInfo" : { + "$ref" : "#/components/schemas/PaymentInfo" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transfer" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" } }, - "transactionDetails": { - "$ref": "#/components/schemas/TransactionDetails" + "transactionDetails" : { + "$ref" : "#/components/schemas/TransactionDetails" }, - "eventStatus": { - "type": "string", - "enum": [ - "NA", - "RETRY", - "FAILED", - "DONE" - ] + "eventStatus" : { + "type" : "string", + "enum" : [ "NA", "RETRY", "FAILED", "DONE", "INGESTED" ] }, - "eventRetryEnrichmentCount": { - "type": "integer", - "format": "int32" + "eventRetryEnrichmentCount" : { + "type" : "integer", + "format" : "int32" } } }, - "Creditor": { - "type": "object", - "properties": { - "idPA": { - "type": "string" + "Creditor" : { + "type" : "object", + "properties" : { + "idPA" : { + "type" : "string" }, - "idBrokerPA": { - "type": "string" + "idBrokerPA" : { + "type" : "string" }, - "idStation": { - "type": "string" + "idStation" : { + "type" : "string" }, - "companyName": { - "type": "string" + "companyName" : { + "type" : "string" }, - "officeName": { - "type": "string" + "officeName" : { + "type" : "string" } } }, - "DebtorPosition": { - "type": "object", - "properties": { - "modelType": { - "type": "string" + "DebtorPosition" : { + "type" : "object", + "properties" : { + "modelType" : { + "type" : "string" }, - "noticeNumber": { - "type": "string" + "noticeNumber" : { + "type" : "string" }, - "iuv": { - "type": "string" + "iuv" : { + "type" : "string" }, - "iur": { - "type": "string" + "iur" : { + "type" : "string" } } }, - "Details": { - "type": "object", - "properties": { - "blurredNumber": { - "type": "string" + "Details" : { + "type" : "object", + "properties" : { + "blurredNumber" : { + "type" : "string" }, - "holder": { - "type": "string" + "holder" : { + "type" : "string" }, - "circuit": { - "type": "string" + "circuit" : { + "type" : "string" } } }, - "Info": { - "type": "object", - "properties": { - "type": { - "type": "string" + "Info" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string" }, - "blurredNumber": { - "type": "string" + "blurredNumber" : { + "type" : "string" }, - "holder": { - "type": "string" + "holder" : { + "type" : "string" }, - "expireMonth": { - "type": "string" + "expireMonth" : { + "type" : "string" }, - "expireYear": { - "type": "string" + "expireYear" : { + "type" : "string" }, - "brand": { - "type": "string" + "brand" : { + "type" : "string" }, - "issuerAbi": { - "type": "string" + "issuerAbi" : { + "type" : "string" }, - "issuerName": { - "type": "string" + "issuerName" : { + "type" : "string" }, - "label": { - "type": "string" + "label" : { + "type" : "string" } } }, - "InfoTransaction": { - "type": "object", - "properties": { - "brand": { - "type": "string" + "InfoTransaction" : { + "type" : "object", + "properties" : { + "brand" : { + "type" : "string" }, - "brandLogo": { - "type": "string" + "brandLogo" : { + "type" : "string" }, - "clientId": { - "type": "string" + "clientId" : { + "type" : "string" }, - "paymentMethodName": { - "type": "string" + "paymentMethodName" : { + "type" : "string" }, - "type": { - "type": "string" + "type" : { + "type" : "string" } } }, - "MBD": { - "type": "object", - "properties": { - "IUBD": { - "type": "string" + "MBD" : { + "type" : "object", + "properties" : { + "IUBD" : { + "type" : "string" }, - "oraAcquisto": { - "type": "string" + "oraAcquisto" : { + "type" : "string" }, - "importo": { - "type": "string" + "importo" : { + "type" : "string" }, - "tipoBollo": { - "type": "string" + "tipoBollo" : { + "type" : "string" }, - "MBDAttachment": { - "type": "string" + "MBDAttachment" : { + "type" : "string" } } }, - "PaymentAuthorizationRequest": { - "type": "object", - "properties": { - "authOutcome": { - "type": "string" + "PaymentAuthorizationRequest" : { + "type" : "object", + "properties" : { + "authOutcome" : { + "type" : "string" }, - "requestId": { - "type": "string" + "requestId" : { + "type" : "string" }, - "correlationId": { - "type": "string" + "correlationId" : { + "type" : "string" }, - "authCode": { - "type": "string" + "authCode" : { + "type" : "string" }, - "paymentMethodType": { - "type": "string" + "paymentMethodType" : { + "type" : "string" }, - "details": { - "$ref": "#/components/schemas/Details" + "details" : { + "$ref" : "#/components/schemas/Details" } } }, - "PaymentInfo": { - "type": "object", - "properties": { - "paymentDateTime": { - "type": "string" + "PaymentInfo" : { + "type" : "object", + "properties" : { + "paymentDateTime" : { + "type" : "string" }, - "applicationDate": { - "type": "string" + "applicationDate" : { + "type" : "string" }, - "transferDate": { - "type": "string" + "transferDate" : { + "type" : "string" }, - "dueDate": { - "type": "string" + "dueDate" : { + "type" : "string" }, - "paymentToken": { - "type": "string" + "paymentToken" : { + "type" : "string" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "fee": { - "type": "string" + "fee" : { + "type" : "string" }, - "primaryCiIncurredFee": { - "type": "string" + "primaryCiIncurredFee" : { + "type" : "string" }, - "idBundle": { - "type": "string" + "idBundle" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "idCiBundle" : { + "type" : "string" }, - "totalNotice": { - "type": "string" + "totalNotice" : { + "type" : "string" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "remittanceInformation": { - "type": "string" + "remittanceInformation" : { + "type" : "string" }, - "description": { - "type": "string" + "description" : { + "type" : "string" }, - "metadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MapEntry" + "metadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/MapEntry" } }, - "IUR": { - "type": "string" + "IUR" : { + "type" : "string" } } }, - "Psp": { - "type": "object", - "properties": { - "idPsp": { - "type": "string" + "Psp" : { + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "psp": { - "type": "string" + "psp" : { + "type" : "string" }, - "pspPartitaIVA": { - "type": "string" + "pspPartitaIVA" : { + "type" : "string" }, - "pspFiscalCode": { - "type": "string" + "pspFiscalCode" : { + "type" : "string" }, - "channelDescription": { - "type": "string" + "channelDescription" : { + "type" : "string" } } }, - "Transaction": { - "type": "object", - "properties": { - "idTransaction": { - "type": "string" + "Transaction" : { + "type" : "object", + "properties" : { + "idTransaction" : { + "type" : "string" }, - "transactionId": { - "type": "string" + "transactionId" : { + "type" : "string" }, - "grandTotal": { - "type": "integer", - "format": "int64" + "grandTotal" : { + "type" : "integer", + "format" : "int64" }, - "amount": { - "type": "integer", - "format": "int64" + "amount" : { + "type" : "integer", + "format" : "int64" }, - "fee": { - "type": "integer", - "format": "int64" + "fee" : { + "type" : "integer", + "format" : "int64" }, - "transactionStatus": { - "type": "string" + "transactionStatus" : { + "type" : "string" }, - "accountingStatus": { - "type": "string" + "accountingStatus" : { + "type" : "string" }, - "rrn": { - "type": "string" + "rrn" : { + "type" : "string" }, - "authorizationCode": { - "type": "string" + "authorizationCode" : { + "type" : "string" }, - "creationDate": { - "type": "string" + "creationDate" : { + "type" : "string" }, - "numAut": { - "type": "string" + "numAut" : { + "type" : "string" }, - "accountCode": { - "type": "string" + "accountCode" : { + "type" : "string" }, - "psp": { - "$ref": "#/components/schemas/TransactionPsp" + "psp" : { + "$ref" : "#/components/schemas/TransactionPsp" }, - "origin": { - "type": "string" + "origin" : { + "type" : "string" } } }, - "TransactionDetails": { - "type": "object", - "properties": { - "user": { - "$ref": "#/components/schemas/User" + "TransactionDetails" : { + "type" : "object", + "properties" : { + "user" : { + "$ref" : "#/components/schemas/User" }, - "paymentAuthorizationRequest": { - "$ref": "#/components/schemas/PaymentAuthorizationRequest" + "paymentAuthorizationRequest" : { + "$ref" : "#/components/schemas/PaymentAuthorizationRequest" }, - "wallet": { - "$ref": "#/components/schemas/WalletItem" + "wallet" : { + "$ref" : "#/components/schemas/WalletItem" }, - "origin": { - "type": "string" + "origin" : { + "type" : "string" }, - "transaction": { - "$ref": "#/components/schemas/Transaction" + "transaction" : { + "$ref" : "#/components/schemas/Transaction" }, - "info": { - "$ref": "#/components/schemas/InfoTransaction" + "info" : { + "$ref" : "#/components/schemas/InfoTransaction" } } }, - "TransactionPsp": { - "type": "object", - "properties": { - "idChannel": { - "type": "string" + "TransactionPsp" : { + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" }, - "businessName": { - "type": "string" + "businessName" : { + "type" : "string" }, - "serviceName": { - "type": "string" + "serviceName" : { + "type" : "string" } } }, - "Transfer": { - "type": "object", - "properties": { - "idTransfer": { - "type": "string" + "Transfer" : { + "type" : "object", + "properties" : { + "idTransfer" : { + "type" : "string" }, - "fiscalCodePA": { - "type": "string" + "fiscalCodePA" : { + "type" : "string" }, - "companyName": { - "type": "string" + "companyName" : { + "type" : "string" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "transferCategory" : { + "type" : "string" }, - "remittanceInformation": { - "type": "string" + "remittanceInformation" : { + "type" : "string" }, - "metadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MapEntry" + "metadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/MapEntry" } }, - "IBAN": { - "type": "string" + "IBAN" : { + "type" : "string" }, - "MBD": { - "$ref": "#/components/schemas/MBD" + "MBD" : { + "$ref" : "#/components/schemas/MBD" } } }, - "User": { - "type": "object", - "properties": { - "fullName": { - "type": "string" + "User" : { + "type" : "object", + "properties" : { + "fullName" : { + "type" : "string" }, - "type": { - "type": "string", - "enum": [ - "F", - "G", - "GUEST" - ] + "type" : { + "type" : "string", + "enum" : [ "F", "G", "GUEST", "REGISTERED" ] }, - "fiscalCode": { - "type": "string" + "fiscalCode" : { + "type" : "string" }, - "notificationEmail": { - "type": "string" + "notificationEmail" : { + "type" : "string" }, - "userId": { - "type": "string" + "userId" : { + "type" : "string" }, - "userStatus": { - "type": "string" + "userStatus" : { + "type" : "string" }, - "userStatusDescription": { - "type": "string" + "userStatusDescription" : { + "type" : "string" } } }, - "WalletItem": { - "type": "object", - "properties": { - "idWallet": { - "type": "string" + "WalletItem" : { + "type" : "object", + "properties" : { + "idWallet" : { + "type" : "string" }, - "walletType": { - "type": "string", - "enum": [ - "CARD", - "PAYPAL", - "BANCOMATPAY" - ] + "walletType" : { + "type" : "string", + "enum" : [ "CARD", "PAYPAL", "BANCOMATPAY" ] }, - "enableableFunctions": { - "type": "array", - "items": { - "type": "string" + "enableableFunctions" : { + "type" : "array", + "items" : { + "type" : "string" } }, - "pagoPa": { - "type": "boolean" + "pagoPa" : { + "type" : "boolean" }, - "onboardingChannel": { - "type": "string" + "onboardingChannel" : { + "type" : "string" }, - "favourite": { - "type": "boolean" + "favourite" : { + "type" : "boolean" }, - "createDate": { - "type": "string" + "createDate" : { + "type" : "string" }, - "info": { - "$ref": "#/components/schemas/Info" + "info" : { + "$ref" : "#/components/schemas/Info" }, - "authRequest": { - "$ref": "#/components/schemas/AuthRequest" + "authRequest" : { + "$ref" : "#/components/schemas/AuthRequest" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi_ec.json b/openapi/openapi_ec.json index 815d67b3..caed3ead 100644 --- a/openapi/openapi_ec.json +++ b/openapi/openapi_ec.json @@ -1,724 +1,661 @@ { - "openapi": "3.0.1", - "info": { - "title": "Biz-Events Service", - "description": "Microservice for exposing REST APIs about payment receipts.", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.1.41" + "openapi" : "3.0.1", + "info" : { + "title" : "Biz-Events Service", + "description" : "Microservice for exposing REST APIs about payment receipts.", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "0.1.41" }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/organizations/{organizationfiscalcode}/receipts/{iur}": { - "get": { - "tags": [ - "Payment Receipts REST APIs" - ], - "summary": "The organization get the receipt for the creditor institution using IUR.", - "operationId": "getOrganizationReceiptIur", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "The fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iur", - "in": "path", - "description": "The unique reference of the operation assigned to the payment (Payment Token).", - "required": true, - "schema": { - "type": "string" - } + "servers" : [ { + "url" : "http://localhost", + "description" : "Generated server url" + } ], + "paths" : { + "/organizations/{organizationfiscalcode}/receipts/{iur}" : { + "get" : { + "tags" : [ "Payment Receipts REST APIs" ], + "summary" : "The organization get the receipt for the creditor institution using IUR.", + "operationId" : "getOrganizationReceiptIur", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "The fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" } - ], - "responses": { - "200": { - "description": "Obtained receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CtReceiptModelResponse" + }, { + "name" : "iur", + "in" : "path", + "description" : "The unique reference of the operation assigned to the payment (Payment Token).", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Obtained receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CtReceiptModelResponse" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/organizations/{organizationfiscalcode}/receipts/{iur}/paymentoptions/{iuv}": { - "get": { - "tags": [ - "Payment Receipts REST APIs" - ], - "summary": "The organization get the receipt for the creditor institution using IUV and IUR.", - "operationId": "getOrganizationReceiptIuvIur", - "parameters": [ - { - "name": "organizationfiscalcode", - "in": "path", - "description": "The fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iur", - "in": "path", - "description": "The unique reference of the operation assigned to the payment (Payment Token).", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iuv", - "in": "path", - "description": "The unique payment identification. Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", - "required": true, - "schema": { - "type": "string" - } + "/organizations/{organizationfiscalcode}/receipts/{iur}/paymentoptions/{iuv}" : { + "get" : { + "tags" : [ "Payment Receipts REST APIs" ], + "summary" : "The organization get the receipt for the creditor institution using IUV and IUR.", + "operationId" : "getOrganizationReceiptIuvIur", + "parameters" : [ { + "name" : "organizationfiscalcode", + "in" : "path", + "description" : "The fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" } - ], - "responses": { - "200": { - "description": "Obtained receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CtReceiptModelResponse" + }, { + "name" : "iur", + "in" : "path", + "description" : "The unique reference of the operation assigned to the payment (Payment Token).", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iuv", + "in" : "path", + "description" : "The unique payment identification. Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "422": { - "description": "Unable to process the request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Obtained receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CtReceiptModelResponse" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "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" + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "500" : { + "description" : "Service unavailable", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "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" } } } }, - "403": { - "description": "Forbidden", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "OK", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } - }, - "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" } } } }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Unauthorized", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] } }, - "components": { - "schemas": { - "CtReceiptModelResponse": { - "required": [ - "channelDescription", - "companyName", - "creditorReferenceId", - "debtor", - "description", - "fiscalCode", - "idChannel", - "idPSP", - "noticeNumber", - "outcome", - "paymentAmount", - "pspCompanyName", - "receiptId", - "transferList" - ], - "type": "object", - "properties": { - "receiptId": { - "type": "string" - }, - "noticeNumber": { - "type": "string" - }, - "fiscalCode": { - "type": "string" - }, - "outcome": { - "type": "string" - }, - "creditorReferenceId": { - "type": "string" - }, - "paymentAmount": { - "type": "number" - }, - "description": { - "type": "string" - }, - "companyName": { - "type": "string" - }, - "officeName": { - "type": "string" - }, - "debtor": { - "$ref": "#/components/schemas/Debtor" - }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferPA" + "components" : { + "schemas" : { + "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" + } + } + }, + "CtReceiptModelResponse" : { + "required" : [ "channelDescription", "companyName", "creditorReferenceId", "debtor", "description", "fiscalCode", "idChannel", "idPSP", "noticeNumber", "outcome", "paymentAmount", "pspCompanyName", "receiptId", "transferList" ], + "type" : "object", + "properties" : { + "receiptId" : { + "type" : "string" + }, + "noticeNumber" : { + "type" : "string" + }, + "fiscalCode" : { + "type" : "string" + }, + "outcome" : { + "type" : "string" + }, + "creditorReferenceId" : { + "type" : "string" + }, + "paymentAmount" : { + "type" : "number" + }, + "description" : { + "type" : "string" + }, + "companyName" : { + "type" : "string" + }, + "officeName" : { + "type" : "string" + }, + "debtor" : { + "$ref" : "#/components/schemas/Debtor" + }, + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransferPA" } }, - "idPSP": { - "type": "string" + "idPSP" : { + "type" : "string" }, - "pspFiscalCode": { - "type": "string" + "pspFiscalCode" : { + "type" : "string" }, - "pspPartitaIVA": { - "type": "string" + "pspPartitaIVA" : { + "type" : "string" }, - "pspCompanyName": { - "type": "string" + "pspCompanyName" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "channelDescription": { - "type": "string" + "channelDescription" : { + "type" : "string" }, - "payer": { - "$ref": "#/components/schemas/Payer" + "payer" : { + "$ref" : "#/components/schemas/Payer" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "fee": { - "type": "number" + "fee" : { + "type" : "number" }, - "primaryCiIncurredFee": { - "type": "number" + "primaryCiIncurredFee" : { + "type" : "number" }, - "idBundle": { - "type": "string" + "idBundle" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "idCiBundle" : { + "type" : "string" }, - "paymentDateTime": { - "type": "string", - "format": "date" + "paymentDateTime" : { + "type" : "string", + "format" : "date" }, - "applicationDate": { - "type": "string", - "format": "date" + "applicationDate" : { + "type" : "string", + "format" : "date" }, - "transferDate": { - "type": "string", - "format": "date" + "transferDate" : { + "type" : "string", + "format" : "date" }, - "metadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MapEntry" + "metadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/MapEntry" } } } }, - "Debtor": { - "required": [ - "entityUniqueIdentifierType", - "entityUniqueIdentifierValue", - "fullName" - ], - "type": "object", - "properties": { - "entityUniqueIdentifierType": { - "type": "string", - "enum": [ - "F", - "G" - ] - }, - "entityUniqueIdentifierValue": { - "type": "string" - }, - "fullName": { - "type": "string" - }, - "streetName": { - "type": "string" - }, - "civicNumber": { - "type": "string" - }, - "postalCode": { - "type": "string" - }, - "city": { - "type": "string" - }, - "stateProvinceRegion": { - "type": "string" - }, - "country": { - "type": "string" - }, - "email": { - "type": "string" + "Debtor" : { + "required" : [ "entityUniqueIdentifierType", "entityUniqueIdentifierValue", "fullName" ], + "type" : "object", + "properties" : { + "entityUniqueIdentifierType" : { + "type" : "string", + "enum" : [ "F", "G" ] + }, + "entityUniqueIdentifierValue" : { + "type" : "string" + }, + "fullName" : { + "type" : "string" + }, + "streetName" : { + "type" : "string" + }, + "civicNumber" : { + "type" : "string" + }, + "postalCode" : { + "type" : "string" + }, + "city" : { + "type" : "string" + }, + "stateProvinceRegion" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "email" : { + "type" : "string" } } }, - "MapEntry": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "MapEntry" : { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" } } }, - "Payer": { - "required": [ - "entityUniqueIdentifierType", - "entityUniqueIdentifierValue", - "fullName" - ], - "type": "object", - "properties": { - "entityUniqueIdentifierType": { - "type": "string", - "enum": [ - "F", - "G" - ] - }, - "entityUniqueIdentifierValue": { - "type": "string" - }, - "fullName": { - "type": "string" - }, - "streetName": { - "type": "string" - }, - "civicNumber": { - "type": "string" - }, - "postalCode": { - "type": "string" - }, - "city": { - "type": "string" - }, - "stateProvinceRegion": { - "type": "string" - }, - "country": { - "type": "string" - }, - "email": { - "type": "string" + "Payer" : { + "required" : [ "entityUniqueIdentifierType", "entityUniqueIdentifierValue", "fullName" ], + "type" : "object", + "properties" : { + "entityUniqueIdentifierType" : { + "type" : "string", + "enum" : [ "F", "G" ] + }, + "entityUniqueIdentifierValue" : { + "type" : "string" + }, + "fullName" : { + "type" : "string" + }, + "streetName" : { + "type" : "string" + }, + "civicNumber" : { + "type" : "string" + }, + "postalCode" : { + "type" : "string" + }, + "city" : { + "type" : "string" + }, + "stateProvinceRegion" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "email" : { + "type" : "string" } } }, - "TransferPA": { - "required": [ - "fiscalCodePA", - "iban", - "mbdAttachment", - "remittanceInformation", - "transferAmount", - "transferCategory" - ], - "type": "object", - "properties": { - "idTransfer": { - "maximum": 5, - "minimum": 1, - "type": "integer", - "format": "int32" - }, - "transferAmount": { - "type": "number" - }, - "fiscalCodePA": { - "type": "string" - }, - "iban": { - "type": "string" - }, - "mbdAttachment": { - "type": "string" - }, - "remittanceInformation": { - "type": "string" - }, - "transferCategory": { - "type": "string" - }, - "metadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MapEntry" + "TransferPA" : { + "required" : [ "fiscalCodePA", "iban", "mbdAttachment", "remittanceInformation", "transferAmount", "transferCategory" ], + "type" : "object", + "properties" : { + "idTransfer" : { + "maximum" : 5, + "minimum" : 1, + "type" : "integer", + "format" : "int32" + }, + "transferAmount" : { + "type" : "number" + }, + "fiscalCodePA" : { + "type" : "string" + }, + "iban" : { + "type" : "string" + }, + "mbdAttachment" : { + "type" : "string" + }, + "remittanceInformation" : { + "type" : "string" + }, + "transferCategory" : { + "type" : "string" + }, + "metadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/MapEntry" } } } }, - "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" - } - } - }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi_helpdesk.json b/openapi/openapi_helpdesk.json index 16a0b35f..f0e16e2a 100644 --- a/openapi/openapi_helpdesk.json +++ b/openapi/openapi_helpdesk.json @@ -1,1044 +1,1006 @@ { - "openapi": "3.0.1", - "info": { - "title": "Biz-Events Service", - "description": "Microservice for exposing REST APIs about payment receipts.", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.1.41" + "openapi" : "3.0.1", + "info" : { + "title" : "Biz-Events Service", + "description" : "Microservice for exposing REST APIs about payment receipts.", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "0.1.41" }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/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" + "servers" : [ { + "url" : "http://localhost", + "description" : "Generated server url" + } ], + "paths" : { + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "500" : { + "description" : "Service unavailable", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "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" } } } }, - "403": { - "description": "Forbidden", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "OK", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } - }, - "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" } } } }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Unauthorized", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/events/{biz-event-id}": { - "get": { - "tags": [ - "Biz-Events Helpdesk" - ], - "summary": "Retrieve the biz-event given its id.", - "operationId": "getBizEvent", - "parameters": [ - { - "name": "biz-event-id", - "in": "path", - "description": "The id of the biz-event.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained biz-event.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BizEvent" + "/events/{biz-event-id}" : { + "get" : { + "tags" : [ "Biz-Events Helpdesk" ], + "summary" : "Retrieve the biz-event given its id.", + "operationId" : "getBizEvent", + "parameters" : [ { + "name" : "biz-event-id", + "in" : "path", + "description" : "The id of the biz-event.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "422": { - "description": "Unable to process the request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the biz-event.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "Not found the biz-event.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Obtained biz-event.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BizEvent" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/events/organizations/{organization-fiscal-code}/iuvs/{iuv}": { - "get": { - "tags": [ - "Biz-Events Helpdesk" - ], - "summary": "Retrieve the biz-event given the organization fiscal code and IUV.", - "operationId": "getBizEventByOrganizationFiscalCodeAndIuv", - "parameters": [ - { - "name": "organization-fiscal-code", - "in": "path", - "description": "The fiscal code of the Organization.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "iuv", - "in": "path", - "description": "The unique payment identification. Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained biz-event.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BizEvent" + "/events/organizations/{organization-fiscal-code}/iuvs/{iuv}" : { + "get" : { + "tags" : [ "Biz-Events Helpdesk" ], + "summary" : "Retrieve the biz-event given the organization fiscal code and IUV.", + "operationId" : "getBizEventByOrganizationFiscalCodeAndIuv", + "parameters" : [ { + "name" : "organization-fiscal-code", + "in" : "path", + "description" : "The fiscal code of the Organization.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iuv", + "in" : "path", + "description" : "The unique payment identification. Alphanumeric code that uniquely associates and identifies three key elements of a payment: reason, payer, amount", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "422": { - "description": "Unable to process the request.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the biz-event.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "Not found the biz-event.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Obtained biz-event.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BizEvent" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] } }, - "components": { - "schemas": { - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - }, - "environment": { - "type": "string" + "components" : { + "schemas" : { + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 + }, + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" } } }, - "ProblemJson": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" - }, - "status": { - "maximum": 600, - "minimum": 100, - "type": "integer", - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "format": "int32", - "example": 200 - }, - "detail": { - "type": "string", - "description": "A human readable explanation specific to this occurrence of the problem.", - "example": "There was an error processing the request" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "environment" : { + "type" : "string" } } }, - "AuthRequest": { - "type": "object", - "properties": { - "authOutcome": { - "type": "string" + "AuthRequest" : { + "type" : "object", + "properties" : { + "authOutcome" : { + "type" : "string" }, - "guid": { - "type": "string" + "guid" : { + "type" : "string" }, - "correlationId": { - "type": "string" + "correlationId" : { + "type" : "string" }, - "error": { - "type": "string" + "error" : { + "type" : "string" }, - "auth_code": { - "type": "string" + "auth_code" : { + "type" : "string" } } }, - "BizEvent": { - "type": "object", - "properties": { - "id": { - "type": "string" + "BizEvent" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "idPaymentManager": { - "type": "string" + "idPaymentManager" : { + "type" : "string" }, - "complete": { - "type": "string" + "complete" : { + "type" : "string" }, - "receiptId": { - "type": "string" + "receiptId" : { + "type" : "string" }, - "missingInfo": { - "type": "array", - "items": { - "type": "string" + "missingInfo" : { + "type" : "array", + "items" : { + "type" : "string" } }, - "debtorPosition": { - "$ref": "#/components/schemas/DebtorPosition" + "debtorPosition" : { + "$ref" : "#/components/schemas/DebtorPosition" }, - "creditor": { - "$ref": "#/components/schemas/Creditor" + "creditor" : { + "$ref" : "#/components/schemas/Creditor" }, - "psp": { - "$ref": "#/components/schemas/Psp" + "psp" : { + "$ref" : "#/components/schemas/Psp" }, - "debtor": { - "$ref": "#/components/schemas/Debtor" + "debtor" : { + "$ref" : "#/components/schemas/Debtor" }, - "payer": { - "$ref": "#/components/schemas/Payer" + "payer" : { + "$ref" : "#/components/schemas/Payer" }, - "paymentInfo": { - "$ref": "#/components/schemas/PaymentInfo" + "paymentInfo" : { + "$ref" : "#/components/schemas/PaymentInfo" }, - "transferList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transfer" + "transferList" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Transfer" } }, - "transactionDetails": { - "$ref": "#/components/schemas/TransactionDetails" - }, - "eventStatus": { - "type": "string", - "enum": [ - "NA", - "RETRY", - "FAILED", - "DONE" - ] - }, - "eventRetryEnrichmentCount": { - "type": "integer", - "format": "int32" + "transactionDetails" : { + "$ref" : "#/components/schemas/TransactionDetails" + }, + "eventStatus" : { + "type" : "string", + "enum" : [ "NA", "RETRY", "FAILED", "DONE", "INGESTED" ] + }, + "eventRetryEnrichmentCount" : { + "type" : "integer", + "format" : "int32" } } }, - "Creditor": { - "type": "object", - "properties": { - "idPA": { - "type": "string" + "Creditor" : { + "type" : "object", + "properties" : { + "idPA" : { + "type" : "string" }, - "idBrokerPA": { - "type": "string" + "idBrokerPA" : { + "type" : "string" }, - "idStation": { - "type": "string" + "idStation" : { + "type" : "string" }, - "companyName": { - "type": "string" + "companyName" : { + "type" : "string" }, - "officeName": { - "type": "string" + "officeName" : { + "type" : "string" } } }, - "Debtor": { - "type": "object", - "properties": { - "fullName": { - "type": "string" + "Debtor" : { + "type" : "object", + "properties" : { + "fullName" : { + "type" : "string" }, - "entityUniqueIdentifierType": { - "type": "string" + "entityUniqueIdentifierType" : { + "type" : "string" }, - "entityUniqueIdentifierValue": { - "type": "string" + "entityUniqueIdentifierValue" : { + "type" : "string" }, - "streetName": { - "type": "string" + "streetName" : { + "type" : "string" }, - "civicNumber": { - "type": "string" + "civicNumber" : { + "type" : "string" }, - "postalCode": { - "type": "string" + "postalCode" : { + "type" : "string" }, - "city": { - "type": "string" + "city" : { + "type" : "string" }, - "stateProvinceRegion": { - "type": "string" + "stateProvinceRegion" : { + "type" : "string" }, - "country": { - "type": "string" + "country" : { + "type" : "string" }, - "eMail": { - "type": "string" + "eMail" : { + "type" : "string" } } }, - "DebtorPosition": { - "type": "object", - "properties": { - "modelType": { - "type": "string" + "DebtorPosition" : { + "type" : "object", + "properties" : { + "modelType" : { + "type" : "string" }, - "noticeNumber": { - "type": "string" + "noticeNumber" : { + "type" : "string" }, - "iuv": { - "type": "string" + "iuv" : { + "type" : "string" }, - "iur": { - "type": "string" + "iur" : { + "type" : "string" } } }, - "Details": { - "type": "object", - "properties": { - "blurredNumber": { - "type": "string" + "Details" : { + "type" : "object", + "properties" : { + "blurredNumber" : { + "type" : "string" }, - "holder": { - "type": "string" + "holder" : { + "type" : "string" }, - "circuit": { - "type": "string" + "circuit" : { + "type" : "string" } } }, - "Info": { - "type": "object", - "properties": { - "type": { - "type": "string" + "Info" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string" }, - "blurredNumber": { - "type": "string" + "blurredNumber" : { + "type" : "string" }, - "holder": { - "type": "string" + "holder" : { + "type" : "string" }, - "expireMonth": { - "type": "string" + "expireMonth" : { + "type" : "string" }, - "expireYear": { - "type": "string" + "expireYear" : { + "type" : "string" }, - "brand": { - "type": "string" + "brand" : { + "type" : "string" }, - "issuerAbi": { - "type": "string" + "issuerAbi" : { + "type" : "string" }, - "issuerName": { - "type": "string" + "issuerName" : { + "type" : "string" }, - "label": { - "type": "string" + "label" : { + "type" : "string" } } }, - "InfoTransaction": { - "type": "object", - "properties": { - "brand": { - "type": "string" + "InfoTransaction" : { + "type" : "object", + "properties" : { + "brand" : { + "type" : "string" }, - "brandLogo": { - "type": "string" + "brandLogo" : { + "type" : "string" }, - "clientId": { - "type": "string" + "clientId" : { + "type" : "string" }, - "paymentMethodName": { - "type": "string" + "paymentMethodName" : { + "type" : "string" }, - "type": { - "type": "string" + "type" : { + "type" : "string" } } }, - "MBD": { - "type": "object", - "properties": { - "IUBD": { - "type": "string" + "MBD" : { + "type" : "object", + "properties" : { + "IUBD" : { + "type" : "string" }, - "oraAcquisto": { - "type": "string" + "oraAcquisto" : { + "type" : "string" }, - "importo": { - "type": "string" + "importo" : { + "type" : "string" }, - "tipoBollo": { - "type": "string" + "tipoBollo" : { + "type" : "string" }, - "MBDAttachment": { - "type": "string" + "MBDAttachment" : { + "type" : "string" } } }, - "MapEntry": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" + "MapEntry" : { + "type" : "object", + "properties" : { + "key" : { + "type" : "string" + }, + "value" : { + "type" : "string" } } }, - "Payer": { - "type": "object", - "properties": { - "fullName": { - "type": "string" + "Payer" : { + "type" : "object", + "properties" : { + "fullName" : { + "type" : "string" }, - "entityUniqueIdentifierType": { - "type": "string" + "entityUniqueIdentifierType" : { + "type" : "string" }, - "entityUniqueIdentifierValue": { - "type": "string" + "entityUniqueIdentifierValue" : { + "type" : "string" }, - "streetName": { - "type": "string" + "streetName" : { + "type" : "string" }, - "civicNumber": { - "type": "string" + "civicNumber" : { + "type" : "string" }, - "postalCode": { - "type": "string" + "postalCode" : { + "type" : "string" }, - "city": { - "type": "string" + "city" : { + "type" : "string" }, - "stateProvinceRegion": { - "type": "string" + "stateProvinceRegion" : { + "type" : "string" }, - "country": { - "type": "string" + "country" : { + "type" : "string" }, - "eMail": { - "type": "string" + "eMail" : { + "type" : "string" } } }, - "PaymentAuthorizationRequest": { - "type": "object", - "properties": { - "authOutcome": { - "type": "string" + "PaymentAuthorizationRequest" : { + "type" : "object", + "properties" : { + "authOutcome" : { + "type" : "string" }, - "requestId": { - "type": "string" + "requestId" : { + "type" : "string" }, - "correlationId": { - "type": "string" + "correlationId" : { + "type" : "string" }, - "authCode": { - "type": "string" + "authCode" : { + "type" : "string" }, - "paymentMethodType": { - "type": "string" + "paymentMethodType" : { + "type" : "string" }, - "details": { - "$ref": "#/components/schemas/Details" + "details" : { + "$ref" : "#/components/schemas/Details" } } }, - "PaymentInfo": { - "type": "object", - "properties": { - "paymentDateTime": { - "type": "string" + "PaymentInfo" : { + "type" : "object", + "properties" : { + "paymentDateTime" : { + "type" : "string" }, - "applicationDate": { - "type": "string" + "applicationDate" : { + "type" : "string" }, - "transferDate": { - "type": "string" + "transferDate" : { + "type" : "string" }, - "dueDate": { - "type": "string" + "dueDate" : { + "type" : "string" }, - "paymentToken": { - "type": "string" + "paymentToken" : { + "type" : "string" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "fee": { - "type": "string" + "fee" : { + "type" : "string" }, - "primaryCiIncurredFee": { - "type": "string" + "primaryCiIncurredFee" : { + "type" : "string" }, - "idBundle": { - "type": "string" + "idBundle" : { + "type" : "string" }, - "idCiBundle": { - "type": "string" + "idCiBundle" : { + "type" : "string" }, - "totalNotice": { - "type": "string" + "totalNotice" : { + "type" : "string" }, - "paymentMethod": { - "type": "string" + "paymentMethod" : { + "type" : "string" }, - "touchpoint": { - "type": "string" + "touchpoint" : { + "type" : "string" }, - "remittanceInformation": { - "type": "string" + "remittanceInformation" : { + "type" : "string" }, - "description": { - "type": "string" + "description" : { + "type" : "string" }, - "metadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MapEntry" + "metadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/MapEntry" } }, - "IUR": { - "type": "string" + "IUR" : { + "type" : "string" } } }, - "Psp": { - "type": "object", - "properties": { - "idPsp": { - "type": "string" + "Psp" : { + "type" : "object", + "properties" : { + "idPsp" : { + "type" : "string" }, - "idBrokerPsp": { - "type": "string" + "idBrokerPsp" : { + "type" : "string" }, - "idChannel": { - "type": "string" + "idChannel" : { + "type" : "string" }, - "psp": { - "type": "string" + "psp" : { + "type" : "string" }, - "pspPartitaIVA": { - "type": "string" + "pspPartitaIVA" : { + "type" : "string" }, - "pspFiscalCode": { - "type": "string" + "pspFiscalCode" : { + "type" : "string" }, - "channelDescription": { - "type": "string" + "channelDescription" : { + "type" : "string" } } }, - "Transaction": { - "type": "object", - "properties": { - "idTransaction": { - "type": "string" + "Transaction" : { + "type" : "object", + "properties" : { + "idTransaction" : { + "type" : "string" }, - "transactionId": { - "type": "string" + "transactionId" : { + "type" : "string" }, - "grandTotal": { - "type": "integer", - "format": "int64" + "grandTotal" : { + "type" : "integer", + "format" : "int64" }, - "amount": { - "type": "integer", - "format": "int64" + "amount" : { + "type" : "integer", + "format" : "int64" }, - "fee": { - "type": "integer", - "format": "int64" + "fee" : { + "type" : "integer", + "format" : "int64" }, - "transactionStatus": { - "type": "string" + "transactionStatus" : { + "type" : "string" }, - "accountingStatus": { - "type": "string" + "accountingStatus" : { + "type" : "string" }, - "rrn": { - "type": "string" + "rrn" : { + "type" : "string" }, - "authorizationCode": { - "type": "string" + "authorizationCode" : { + "type" : "string" }, - "creationDate": { - "type": "string" + "creationDate" : { + "type" : "string" }, - "numAut": { - "type": "string" + "numAut" : { + "type" : "string" }, - "accountCode": { - "type": "string" + "accountCode" : { + "type" : "string" }, - "psp": { - "$ref": "#/components/schemas/TransactionPsp" + "psp" : { + "$ref" : "#/components/schemas/TransactionPsp" }, - "origin": { - "type": "string" + "origin" : { + "type" : "string" } } }, - "TransactionDetails": { - "type": "object", - "properties": { - "user": { - "$ref": "#/components/schemas/User" + "TransactionDetails" : { + "type" : "object", + "properties" : { + "user" : { + "$ref" : "#/components/schemas/User" }, - "paymentAuthorizationRequest": { - "$ref": "#/components/schemas/PaymentAuthorizationRequest" + "paymentAuthorizationRequest" : { + "$ref" : "#/components/schemas/PaymentAuthorizationRequest" }, - "wallet": { - "$ref": "#/components/schemas/WalletItem" + "wallet" : { + "$ref" : "#/components/schemas/WalletItem" }, - "origin": { - "type": "string" + "origin" : { + "type" : "string" }, - "transaction": { - "$ref": "#/components/schemas/Transaction" + "transaction" : { + "$ref" : "#/components/schemas/Transaction" }, - "info": { - "$ref": "#/components/schemas/InfoTransaction" + "info" : { + "$ref" : "#/components/schemas/InfoTransaction" } } }, - "TransactionPsp": { - "type": "object", - "properties": { - "idChannel": { - "type": "string" + "TransactionPsp" : { + "type" : "object", + "properties" : { + "idChannel" : { + "type" : "string" }, - "businessName": { - "type": "string" + "businessName" : { + "type" : "string" }, - "serviceName": { - "type": "string" + "serviceName" : { + "type" : "string" } } }, - "Transfer": { - "type": "object", - "properties": { - "idTransfer": { - "type": "string" + "Transfer" : { + "type" : "object", + "properties" : { + "idTransfer" : { + "type" : "string" }, - "fiscalCodePA": { - "type": "string" + "fiscalCodePA" : { + "type" : "string" }, - "companyName": { - "type": "string" + "companyName" : { + "type" : "string" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "transferCategory": { - "type": "string" + "transferCategory" : { + "type" : "string" }, - "remittanceInformation": { - "type": "string" + "remittanceInformation" : { + "type" : "string" }, - "metadata": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MapEntry" + "metadata" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/MapEntry" } }, - "IBAN": { - "type": "string" + "IBAN" : { + "type" : "string" }, - "MBD": { - "$ref": "#/components/schemas/MBD" + "MBD" : { + "$ref" : "#/components/schemas/MBD" } } }, - "User": { - "type": "object", - "properties": { - "fullName": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "F", - "G", - "GUEST" - ] - }, - "fiscalCode": { - "type": "string" - }, - "notificationEmail": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "userStatus": { - "type": "string" - }, - "userStatusDescription": { - "type": "string" + "User" : { + "type" : "object", + "properties" : { + "fullName" : { + "type" : "string" + }, + "type" : { + "type" : "string", + "enum" : [ "F", "G", "GUEST", "REGISTERED" ] + }, + "fiscalCode" : { + "type" : "string" + }, + "notificationEmail" : { + "type" : "string" + }, + "userId" : { + "type" : "string" + }, + "userStatus" : { + "type" : "string" + }, + "userStatusDescription" : { + "type" : "string" } } }, - "WalletItem": { - "type": "object", - "properties": { - "idWallet": { - "type": "string" - }, - "walletType": { - "type": "string", - "enum": [ - "CARD", - "PAYPAL", - "BANCOMATPAY" - ] - }, - "enableableFunctions": { - "type": "array", - "items": { - "type": "string" + "WalletItem" : { + "type" : "object", + "properties" : { + "idWallet" : { + "type" : "string" + }, + "walletType" : { + "type" : "string", + "enum" : [ "CARD", "PAYPAL", "BANCOMATPAY" ] + }, + "enableableFunctions" : { + "type" : "array", + "items" : { + "type" : "string" } }, - "pagoPa": { - "type": "boolean" + "pagoPa" : { + "type" : "boolean" }, - "onboardingChannel": { - "type": "string" + "onboardingChannel" : { + "type" : "string" }, - "favourite": { - "type": "boolean" + "favourite" : { + "type" : "boolean" }, - "createDate": { - "type": "string" + "createDate" : { + "type" : "string" }, - "info": { - "$ref": "#/components/schemas/Info" + "info" : { + "$ref" : "#/components/schemas/Info" }, - "authRequest": { - "$ref": "#/components/schemas/AuthRequest" + "authRequest" : { + "$ref" : "#/components/schemas/AuthRequest" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi_io.json b/openapi/openapi_io.json index ee83e109..f1b15071 100644 --- a/openapi/openapi_io.json +++ b/openapi/openapi_io.json @@ -1,1029 +1,1023 @@ { - "openapi": "3.0.1", - "info": { - "title": "Biz-Events Service", - "description": "Microservice for exposing REST APIs about payment receipts.", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.1.41" + "openapi" : "3.0.1", + "info" : { + "title" : "Biz-Events Service", + "description" : "Microservice for exposing REST APIs about payment receipts.", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "0.1.41" }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/transactions/{transaction-id}/disable": { - "post": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Disable the transaction details given its id.", - "operationId": "disableTransaction", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "transaction-id", - "in": "path", - "description": "The id of the transaction.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Disabled Transactions.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "servers" : [ { + "url" : "http://localhost", + "description" : "Generated server url" + } ], + "paths" : { + "/transactions/{transaction-id}/disable" : { + "post" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Disable the transaction details given its id.", + "operationId" : "disableTransaction", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "transaction-id", + "in" : "path", + "description" : "The id of the transaction.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Disabled Transactions.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": {} + "content" : { + "application/json" : { } } }, - "401": { - "description": "Wrong or missing function key.", - "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" } } } }, - "404": { - "description": "Not found the transaction.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "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" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the transaction.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions": { - "get": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Retrieve the paged transaction list from biz events.", - "operationId": "getTransactionList", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "x-continuation-token", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - } - ], - "responses": { - "200": { - "description": "Obtained transaction list.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions" : { + "get" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Retrieve the paged transaction list from biz events.", + "operationId" : "getTransactionList", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "is_payer", + "in" : "query", + "description" : "Filter by payer", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "is_debtor", + "in" : "query", + "description" : "Filter by debtor", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "x-continuation-token", + "in" : "header", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "size", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "orderby", + "in" : "query", + "description" : "Order by TRANSACTION_DATE", + "required" : false, + "schema" : { + "type" : "string", + "default" : "TRANSACTION_DATE", + "enum" : [ "TRANSACTION_DATE" ] + } + }, { + "name" : "ordering", + "in" : "query", + "description" : "Direction of ordering", + "required" : false, + "schema" : { + "type" : "string", + "default" : "DESC", + "enum" : [ "ASC", "DESC" ] + } + } ], + "responses" : { + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } + }, + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } + }, + "200" : { + "description" : "Obtained transaction list.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } }, - "x-continuation-token": { - "description": "continuation token for paginated query", - "style": "simple", - "schema": { - "type": "string" + "x-continuation-token" : { + "description" : "continuation token for paginated query", + "style" : "simple", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionListWrapResponse" - } - } - } - }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TransactionListWrapResponse" } } } }, - "404": { - "description": "Not found the transaction.", - "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": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" - } - } - } - }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the transaction.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions/{transaction-id}": { - "get": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Retrieve the transaction details given its id.", - "operationId": "getTransactionDetails", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "transaction-id", - "in": "path", - "description": "The id of the transaction.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "Not found the transaction.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions/{transaction-id}" : { + "get" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Retrieve the transaction details given its id.", + "operationId" : "getTransactionDetails", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "transaction-id", + "in" : "path", + "description" : "The id of the transaction.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } + }, + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } + }, + "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" - } - } - } - }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "200": { - "description": "Obtained transaction details.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the transaction.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionDetailResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Obtained transaction details.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TransactionDetailResponse" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions/{event-id}/pdf": { - "get": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Retrieve the PDF receipt given event id.", - "operationId": "getPDFReceipt", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "event-id", - "in": "path", - "description": "The id of the event.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Obtained the PDF receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions/{event-id}/pdf" : { + "get" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Retrieve the PDF receipt given event id.", + "operationId" : "getPDFReceipt", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "event-id", + "in" : "path", + "description" : "The id of the event.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "404" : { + "description" : "Not found the receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/pdf": { - "schema": { - "type": "string", - "format": "binary" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "404": { - "description": "Not found the receipt.", - "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" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "Obtained the PDF receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + }, + "content" : { + "application/pdf" : { + "schema" : { + "type" : "string", + "format" : "binary" } } } }, - "422": { - "description": "Unprocessable receipt.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "422" : { + "description" : "Unprocessable receipt.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] }, - "/transactions/cached": { - "get": { - "tags": [ - "IO Transactions REST APIs" - ], - "summary": "Retrieve the paged transaction list from biz events.", - "operationId": "getTransactionList_1", - "parameters": [ - { - "name": "x-fiscal-code", - "in": "header", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - } - ], - "responses": { - "200": { - "description": "Obtained transaction list.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/transactions/cached" : { + "get" : { + "tags" : [ "IO Transactions REST APIs" ], + "summary" : "Retrieve the paged transaction list from biz events.", + "operationId" : "getTransactionList_1", + "parameters" : [ { + "name" : "x-fiscal-code", + "in" : "header", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "is_payer", + "in" : "query", + "description" : "Filter by payer", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "is_debtor", + "in" : "query", + "description" : "Filter by debtor", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "page", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 0 + } + }, { + "name" : "size", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "orderby", + "in" : "query", + "description" : "Order by TRANSACTION_DATE", + "required" : false, + "schema" : { + "type" : "string", + "default" : "TRANSACTION_DATE", + "enum" : [ "TRANSACTION_DATE" ] + } + }, { + "name" : "ordering", + "in" : "query", + "description" : "Direction of ordering", + "required" : false, + "schema" : { + "type" : "string", + "default" : "DESC", + "enum" : [ "ASC", "DESC" ] + } + } ], + "responses" : { + "429" : { + "description" : "Too many requests.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } + }, + "200" : { + "description" : "Obtained transaction list.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionListWrapResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TransactionListWrapResponse" } } } }, - "401": { - "description": "Wrong or missing function key.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "Not found the transaction.", - "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" - } - } - } - }, - "429": { - "description": "Too many requests.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "500": { - "description": "Service unavailable.", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "Not found the transaction.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "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" + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "500" : { + "description" : "Service unavailable", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "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" + "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" } } } }, - "403": { - "description": "Forbidden", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "200" : { + "description" : "OK", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } - } - }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } - }, - "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" } } } }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Unauthorized", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "required": false, - "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.", + "required" : false, + "schema" : { + "type" : "string" } - ] + } ] } }, - "components": { - "schemas": { - "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" + "components" : { + "schemas" : { + "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" } } }, - "PageInfo": { - "required": [ - "items_found", - "limit", - "page", - "total_pages" - ], - "type": "object", - "properties": { - "page": { - "type": "integer", - "description": "Page number", - "format": "int32" - }, - "limit": { - "type": "integer", - "description": "Required number of items per page", - "format": "int32" - }, - "items_found": { - "type": "integer", - "description": "Number of items found. (The last page may have fewer elements than required)", - "format": "int32" - }, - "total_pages": { - "type": "integer", - "description": "Total number of pages", - "format": "int32" + "PageInfo" : { + "required" : [ "items_found", "limit", "page", "total_pages" ], + "type" : "object", + "properties" : { + "page" : { + "type" : "integer", + "description" : "Page number", + "format" : "int32" + }, + "limit" : { + "type" : "integer", + "description" : "Required number of items per page", + "format" : "int32" + }, + "items_found" : { + "type" : "integer", + "description" : "Number of items found. (The last page may have fewer elements than required)", + "format" : "int32" + }, + "total_pages" : { + "type" : "integer", + "description" : "Total number of pages", + "format" : "int32" } } }, - "TransactionListItem": { - "type": "object", - "properties": { - "transactionId": { - "type": "string" + "TransactionListItem" : { + "type" : "object", + "properties" : { + "transactionId" : { + "type" : "string" }, - "payeeName": { - "type": "string" + "payeeName" : { + "type" : "string" }, - "payeeTaxCode": { - "type": "string" + "payeeTaxCode" : { + "type" : "string" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "transactionDate": { - "type": "string" + "transactionDate" : { + "type" : "string" }, - "isCart": { - "type": "boolean" + "isCart" : { + "type" : "boolean" }, - "isPayer": { - "type": "boolean" + "isPayer" : { + "type" : "boolean" }, - "isDebtor": { - "type": "boolean" + "isDebtor" : { + "type" : "boolean" } } }, - "TransactionListWrapResponse": { - "type": "object", - "properties": { - "transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransactionListItem" + "TransactionListWrapResponse" : { + "type" : "object", + "properties" : { + "transactions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TransactionListItem" } }, - "page_info": { - "$ref": "#/components/schemas/PageInfo" + "page_info" : { + "$ref" : "#/components/schemas/PageInfo" } } }, - "CartItem": { - "type": "object", - "properties": { - "subject": { - "type": "string" + "CartItem" : { + "type" : "object", + "properties" : { + "subject" : { + "type" : "string" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "payee": { - "$ref": "#/components/schemas/UserDetail" + "payee" : { + "$ref" : "#/components/schemas/UserDetail" }, - "debtor": { - "$ref": "#/components/schemas/UserDetail" + "debtor" : { + "$ref" : "#/components/schemas/UserDetail" }, - "refNumberValue": { - "type": "string" + "refNumberValue" : { + "type" : "string" }, - "refNumberType": { - "type": "string" + "refNumberType" : { + "type" : "string" } } }, - "InfoTransactionView": { - "type": "object", - "properties": { - "transactionId": { - "type": "string" + "InfoTransactionView" : { + "type" : "object", + "properties" : { + "transactionId" : { + "type" : "string" }, - "authCode": { - "type": "string" + "authCode" : { + "type" : "string" }, - "rrn": { - "type": "string" + "rrn" : { + "type" : "string" }, - "transactionDate": { - "type": "string" + "transactionDate" : { + "type" : "string" }, - "pspName": { - "type": "string" + "pspName" : { + "type" : "string" }, - "walletInfo": { - "$ref": "#/components/schemas/WalletInfo" + "walletInfo" : { + "$ref" : "#/components/schemas/WalletInfo" }, - "paymentMethod": { - "type": "string", - "enum": [ - "BBT", - "BP", - "AD", - "CP", - "PO", - "OBEP", - "JIF", - "MYBK", - "PPAL", - "UNKNOWN" - ] + "paymentMethod" : { + "type" : "string", + "enum" : [ "BBT", "BP", "AD", "CP", "PO", "OBEP", "JIF", "MYBK", "PPAL", "UNKNOWN" ] }, - "payer": { - "$ref": "#/components/schemas/UserDetail" + "payer" : { + "$ref" : "#/components/schemas/UserDetail" }, - "amount": { - "type": "string" + "amount" : { + "type" : "string" }, - "fee": { - "type": "string" + "fee" : { + "type" : "string" }, - "origin": { - "type": "string", - "enum": [ - "INTERNAL", - "PM", - "NDP001PROD", - "NDP002PROD", - "NDP003PROD", - "UNKNOWN" - ] + "origin" : { + "type" : "string", + "enum" : [ "INTERNAL", "PM", "NDP001PROD", "NDP002PROD", "NDP003PROD", "UNKNOWN" ] } } }, - "TransactionDetailResponse": { - "type": "object", - "properties": { - "infoTransaction": { - "$ref": "#/components/schemas/InfoTransactionView" + "TransactionDetailResponse" : { + "type" : "object", + "properties" : { + "infoTransaction" : { + "$ref" : "#/components/schemas/InfoTransactionView" }, - "carts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CartItem" + "carts" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CartItem" } } } }, - "UserDetail": { - "type": "object", - "properties": { - "name": { - "type": "string" + "UserDetail" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "taxCode": { - "type": "string" + "taxCode" : { + "type" : "string" } } }, - "WalletInfo": { - "type": "object", - "properties": { - "accountHolder": { - "type": "string" + "WalletInfo" : { + "type" : "object", + "properties" : { + "accountHolder" : { + "type" : "string" }, - "brand": { - "type": "string" + "brand" : { + "type" : "string" }, - "blurredNumber": { - "type": "string" + "blurredNumber" : { + "type" : "string" }, - "maskedEmail": { - "type": "string" + "maskedEmail" : { + "type" : "string" } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/openapi/openapi_io_patch.json b/openapi/openapi_io_patch.json index 55a01e54..282dbace 100644 --- a/openapi/openapi_io_patch.json +++ b/openapi/openapi_io_patch.json @@ -131,26 +131,7 @@ ], "summary": "Retrieve the paged transaction list from biz events.", "operationId": "getTransactionList", - "parameters": [ - { - "name": "x-continuation-token", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "size", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { + "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.", @@ -158,8 +139,59 @@ "schema": { "type": "string" } + }, { + "name" : "is_payer", + "in" : "query", + "description" : "Filter by payer", + "required" : false, + "schema" : { + "type" : "boolean" } - ], + }, { + "name" : "is_debtor", + "in" : "query", + "description" : "Filter by debtor", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "x-continuation-token", + "in" : "header", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "size", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "orderby", + "in" : "query", + "description" : "Order by TRANSACTION_DATE", + "required" : false, + "schema" : { + "type" : "string", + "default" : "TRANSACTION_DATE", + "enum" : [ "TRANSACTION_DATE" ] + } + }, { + "name" : "ordering", + "in" : "query", + "description" : "Direction of ordering", + "required" : false, + "schema" : { + "type" : "string", + "default" : "DESC", + "enum" : [ "ASC", "DESC" ] + } + } ], "responses": { "429": { "description": "Too many requests.", @@ -502,28 +534,69 @@ ], "summary": "Retrieve the paged transaction list from biz events.", "operationId": "getTransactionList_1", - "parameters": [ - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "size", - "in": "query", + "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.", "required": false, "schema": { - "type": "integer", - "format": "int32", - "default": 10 + "type": "string" } + }, { + "name" : "is_payer", + "in" : "query", + "description" : "Filter by payer", + "required" : false, + "schema" : { + "type" : "boolean" } - ], + }, { + "name" : "is_debtor", + "in" : "query", + "description" : "Filter by debtor", + "required" : false, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "page", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 0 + } + }, { + "name" : "size", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "orderby", + "in" : "query", + "description" : "Order by TRANSACTION_DATE", + "required" : false, + "schema" : { + "type" : "string", + "default" : "TRANSACTION_DATE", + "enum" : [ "TRANSACTION_DATE" ] + } + }, { + "name" : "ordering", + "in" : "query", + "description" : "Direction of ordering", + "required" : false, + "schema" : { + "type" : "string", + "default" : "DESC", + "enum" : [ "ASC", "DESC" ] + } + } ], "responses": { "200": { "description": "Obtained transaction list.", @@ -958,4 +1031,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/bizeventsservice/controller/ITransactionController.java b/src/main/java/it/gov/pagopa/bizeventsservice/controller/ITransactionController.java index 71b08b0f..a3617e77 100644 --- a/src/main/java/it/gov/pagopa/bizeventsservice/controller/ITransactionController.java +++ b/src/main/java/it/gov/pagopa/bizeventsservice/controller/ITransactionController.java @@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import it.gov.pagopa.bizeventsservice.model.ProblemJson; +import it.gov.pagopa.bizeventsservice.model.filterandorder.Order; import it.gov.pagopa.bizeventsservice.model.response.transaction.TransactionDetailResponse; import it.gov.pagopa.bizeventsservice.model.response.transaction.TransactionListWrapResponse; @@ -22,7 +23,9 @@ import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.data.domain.Sort; +import javax.validation.Valid; import javax.validation.constraints.NotBlank; @@ -40,8 +43,12 @@ public interface ITransactionController { * recovers biz-event data for the transaction list * * @param fiscalCode tokenized user fiscal code + * @param isPayer optional flag defining the filter to select only the notices where the user is the payer + * @param isDebtor optional flag defining the filter to select only the notices where the user is the debtor * @param continuationToken continuation token for paginated query - * @param size optional parameter defining page size, defaults to 5 + * @param size optional parameter defining page size, defaults to 10 + * @param orderBy optional parameter defining the sort field for the returned list, defaults to TRANSACTION_DATE + * @param ordering optional parameter defining the sorting direction of the returned list, defaults to DESC * @return the transaction list */ @GetMapping @@ -57,17 +64,24 @@ public interface ITransactionController { @SecurityRequirement(name = "ApiKey")}, operationId = "getTransactionList") ResponseEntity getTransactionList( @RequestHeader(name = X_FISCAL_CODE) String fiscalCode, + @Valid @Parameter(description = "Filter by payer") @RequestParam(value = "is_payer", required = false) Boolean isPayer, + @Valid @Parameter(description = "Filter by debtor") @RequestParam(value = "is_debtor", required = false) Boolean isDebtor, @RequestHeader(name = X_CONTINUATION_TOKEN, required = false) String continuationToken, - @RequestParam(name = PAGE_SIZE, required = false, defaultValue = "10") Integer size + @RequestParam(name = PAGE_SIZE, required = false, defaultValue = "10") Integer size, + @RequestParam(required = false, name = "orderby", defaultValue = "TRANSACTION_DATE") @Parameter(description = "Order by TRANSACTION_DATE") Order.TransactionListOrder orderBy, + @RequestParam(required = false, name = "ordering", defaultValue = "DESC") @Parameter(description = "Direction of ordering") Sort.Direction ordering); - ); /** * recovers biz-event data for the transaction list * * @param fiscalCode tokenized user fiscal code + * @param isPayer optional flag defining the filter to select only the notices where the user is the payer + * @param isDebtor optional flag defining the filter to select only the notices where the user is the debtor * @param page optional parameter defining page number, default to 0 (first page) * @param size optional parameter defining page size, defaults to 10 + * @param orderBy optional parameter defining the sort field for the returned list, defaults to TRANSACTION_DATE + * @param ordering optional parameter defining the sorting direction of the returned list, defaults to DESC * @return the transaction list */ @GetMapping(value = "/cached", produces = MediaType.APPLICATION_JSON_VALUE) @@ -82,9 +96,12 @@ ResponseEntity getTransactionList( @SecurityRequirement(name = "ApiKey")}, operationId = "getTransactionList") ResponseEntity getCachedTransactionList( @RequestHeader(name = X_FISCAL_CODE) String fiscalCode, + @Valid @Parameter(description = "Filter by payer") @RequestParam(value = "is_payer", required = false) Boolean isPayer, + @Valid @Parameter(description = "Filter by debtor") @RequestParam(value = "is_debtor", required = false) Boolean isDebtor, @RequestParam(name = PAGE_NUMBER, required = false, defaultValue = "0") Integer page, - @RequestParam(name = PAGE_SIZE, required = false, defaultValue = "10") Integer size - ); + @RequestParam(name = PAGE_SIZE, required = false, defaultValue = "10") Integer size, + @RequestParam(required = false, name = "orderby", defaultValue = "TRANSACTION_DATE") @Parameter(description = "Order by TRANSACTION_DATE") Order.TransactionListOrder orderBy, + @RequestParam(required = false, name = "ordering", defaultValue = "DESC") @Parameter(description = "Direction of ordering") Sort.Direction ordering); @Operation(summary = "Retrieve the transaction details given its id.", security = { @SecurityRequirement(name = "ApiKey")}, operationId = "getTransactionDetails") diff --git a/src/main/java/it/gov/pagopa/bizeventsservice/controller/impl/TransactionController.java b/src/main/java/it/gov/pagopa/bizeventsservice/controller/impl/TransactionController.java index c059bc46..94806ca4 100644 --- a/src/main/java/it/gov/pagopa/bizeventsservice/controller/impl/TransactionController.java +++ b/src/main/java/it/gov/pagopa/bizeventsservice/controller/impl/TransactionController.java @@ -3,12 +3,14 @@ import it.gov.pagopa.bizeventsservice.client.IReceiptGeneratePDFClient; import it.gov.pagopa.bizeventsservice.client.IReceiptGetPDFClient; import it.gov.pagopa.bizeventsservice.controller.ITransactionController; +import it.gov.pagopa.bizeventsservice.model.filterandorder.Order.TransactionListOrder; import it.gov.pagopa.bizeventsservice.model.response.transaction.TransactionDetailResponse; import it.gov.pagopa.bizeventsservice.model.response.transaction.TransactionListResponse; import it.gov.pagopa.bizeventsservice.model.response.transaction.TransactionListWrapResponse; import it.gov.pagopa.bizeventsservice.service.IBizEventsService; import it.gov.pagopa.bizeventsservice.service.ITransactionService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort.Direction; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -33,10 +35,12 @@ public TransactionController(ITransactionService transactionService, IBizEventsS this.bizEventsService = bizEventsService; } + @Override - public ResponseEntity getTransactionList( - String fiscalCode, String continuationToken, Integer size) { - TransactionListResponse transactionListResponse = transactionService.getTransactionList(fiscalCode, continuationToken, size); + public ResponseEntity getTransactionList(String fiscalCode, Boolean isPayer, Boolean isDebtor, + String continuationToken, Integer size, TransactionListOrder orderBy, Direction ordering) { + TransactionListResponse transactionListResponse = transactionService.getTransactionList(fiscalCode, isPayer, isDebtor, + continuationToken, size, orderBy, ordering); return ResponseEntity.ok() .header(X_CONTINUATION_TOKEN, transactionListResponse.getContinuationToken()) @@ -44,9 +48,10 @@ public ResponseEntity getTransactionList( } @Override - public ResponseEntity getCachedTransactionList(String fiscalCode, - Integer page, Integer size) { - TransactionListResponse transactionListResponse = transactionService.getCachedTransactionList(fiscalCode, page, size); + public ResponseEntity getCachedTransactionList(String fiscalCode, Boolean isPayer, Boolean isDebtor, + Integer page, Integer size, TransactionListOrder orderBy, Direction ordering) { + TransactionListResponse transactionListResponse = transactionService.getCachedTransactionList(fiscalCode, isPayer, isDebtor, + page, size, orderBy, ordering); return ResponseEntity.ok() .body(TransactionListWrapResponse.builder() .transactions(transactionListResponse.getTransactionList()) @@ -79,4 +84,6 @@ public ResponseEntity getPDFReceipt(@NotBlank String fiscalCode, @NotBla .header("content-disposition", "filename=receipt") .body(receiptFile); } + + } diff --git a/src/main/java/it/gov/pagopa/bizeventsservice/exception/AppError.java b/src/main/java/it/gov/pagopa/bizeventsservice/exception/AppError.java index 3ef822ef..cb5d7e32 100644 --- a/src/main/java/it/gov/pagopa/bizeventsservice/exception/AppError.java +++ b/src/main/java/it/gov/pagopa/bizeventsservice/exception/AppError.java @@ -18,7 +18,8 @@ public enum AppError { INVALID_FISCAL_CODE(HttpStatus.BAD_REQUEST, INVALID_DATA, "Provided Fiscal Code %s is invalid"), - VIEW_USER_NOT_FOUND_WITH_TAX_CODE(HttpStatus.NOT_FOUND, VIEW_USER_NOT_FOUND, "Not found a biz-events-view-user with the given tax code"), + VIEW_USER_NOT_FOUND_WITH_TAX_CODE(HttpStatus.NOT_FOUND, VIEW_USER_NOT_FOUND, "Not found a biz-events-view-user with tax code %s"), + VIEW_USER_NOT_FOUND_WITH_TAX_CODE_AND_FILTER(HttpStatus.NOT_FOUND, VIEW_USER_NOT_FOUND, "Not found a biz-events-view-user with tax code %s and is_payer filter set to %s and is_debtor filter set to %s"), VIEW_USER_NOT_FOUND_WITH_TRANSACTION_ID(HttpStatus.NOT_FOUND, VIEW_USER_NOT_FOUND, "Not found a biz-events-view-user with tax code %s and id %s"), VIEW_GENERAL_NOT_FOUND_WITH_TRANSACTION_ID(HttpStatus.NOT_FOUND, VIEW_GENERAL_NOT_FOUND, "Not found a biz-events-view-general with id %s"), VIEW_CART_NOT_FOUND_WITH_TRANSACTION_ID_AND_TAX_CODE(HttpStatus.NOT_FOUND, VIEW_CART_NOT_FOUND, "Not found a biz-events-view-cart with id %s for the given tax code"), diff --git a/src/main/java/it/gov/pagopa/bizeventsservice/model/filterandorder/Order.java b/src/main/java/it/gov/pagopa/bizeventsservice/model/filterandorder/Order.java index 377856f3..49f4aabd 100644 --- a/src/main/java/it/gov/pagopa/bizeventsservice/model/filterandorder/Order.java +++ b/src/main/java/it/gov/pagopa/bizeventsservice/model/filterandorder/Order.java @@ -17,8 +17,7 @@ public class Order { @Getter @AllArgsConstructor public enum TransactionListOrder implements OrderType { - TRANSACTION_DATE("transactionDate"), - TAX_CODE("taxCode"); + TRANSACTION_DATE("transactionDate"); private final String columnName; diff --git a/src/main/java/it/gov/pagopa/bizeventsservice/repository/BizEventsViewUserRepository.java b/src/main/java/it/gov/pagopa/bizeventsservice/repository/BizEventsViewUserRepository.java index 06fc0cf5..e345453a 100644 --- a/src/main/java/it/gov/pagopa/bizeventsservice/repository/BizEventsViewUserRepository.java +++ b/src/main/java/it/gov/pagopa/bizeventsservice/repository/BizEventsViewUserRepository.java @@ -15,11 +15,12 @@ */ @Repository public interface BizEventsViewUserRepository extends CosmosRepository { - @Query("select * from c where c.taxCode = @taxCode and c.hidden = false") - Page getBizEventsViewUserByTaxCode(@Param("taxCode") String taxCode, Pageable pageable); - - @Query("select * from c where c.taxCode = @taxCode and c.hidden = false") - List getBizEventsViewUserByTaxCode(@Param("taxCode") String taxCode); + + @Query("SELECT * FROM c WHERE c.taxCode = @taxCode AND c.hidden = false AND (IS_NULL(@isPayer) = true OR c.isPayer = @isPayer) AND (IS_NULL(@isDebtor) = true OR c.isDebtor = @isDebtor)") + Page getBizEventsViewUserByTaxCode(@Param("taxCode") String taxCode, @Param("isPayer") Boolean isPayer, @Param("isDebtor") Boolean isDebtor, Pageable pageable); + + @Query("select * from c where c.taxCode = @taxCode and c.hidden = false") + List getBizEventsViewUserByTaxCode(@Param("taxCode") String taxCode); @Query("select * from c where c.transactionId=@transactionId and c.taxCode = @fiscalCode and c.hidden = false") List getBizEventsViewUserByTaxCodeAndTransactionId(String fiscalCode, String transactionId); diff --git a/src/main/java/it/gov/pagopa/bizeventsservice/service/ITransactionService.java b/src/main/java/it/gov/pagopa/bizeventsservice/service/ITransactionService.java index 820e83f8..43e8606c 100644 --- a/src/main/java/it/gov/pagopa/bizeventsservice/service/ITransactionService.java +++ b/src/main/java/it/gov/pagopa/bizeventsservice/service/ITransactionService.java @@ -1,5 +1,8 @@ package it.gov.pagopa.bizeventsservice.service; +import org.springframework.data.domain.Sort.Direction; + +import it.gov.pagopa.bizeventsservice.model.filterandorder.Order.TransactionListOrder; import it.gov.pagopa.bizeventsservice.model.response.transaction.TransactionDetailResponse; import it.gov.pagopa.bizeventsservice.model.response.transaction.TransactionListResponse; @@ -12,8 +15,8 @@ public interface ITransactionService { * @param size offset size * @return transaction list */ - TransactionListResponse getTransactionList(String fiscalCode, String continuationToken, Integer size); - TransactionListResponse getCachedTransactionList(String fiscalCode, Integer page, Integer size); + TransactionListResponse getTransactionList(String fiscalCode, Boolean isPayer, Boolean isDebtor, String continuationToken, Integer size, TransactionListOrder orderBy, Direction ordering); + TransactionListResponse getCachedTransactionList(String fiscalCode, Boolean isPayer, Boolean isDebtor, Integer page, Integer size, TransactionListOrder orderBy, Direction ordering); TransactionDetailResponse getTransactionDetails(String fiscalCode, String transactionId); byte[] getPDFReceipt (String fiscalCode, String eventId); diff --git a/src/main/java/it/gov/pagopa/bizeventsservice/service/impl/TransactionService.java b/src/main/java/it/gov/pagopa/bizeventsservice/service/impl/TransactionService.java index 04721ae1..44ca92e9 100644 --- a/src/main/java/it/gov/pagopa/bizeventsservice/service/impl/TransactionService.java +++ b/src/main/java/it/gov/pagopa/bizeventsservice/service/impl/TransactionService.java @@ -39,6 +39,7 @@ import java.util.Comparator; import java.util.HashSet; import java.util.List; +import java.util.Optional; import java.util.Set; @Service @@ -71,20 +72,23 @@ public TransactionService(BizEventsViewGeneralRepository bizEventsViewGeneralRep } @Override - public TransactionListResponse getTransactionList( - String taxCode, String continuationToken, Integer size) { + public TransactionListResponse getTransactionList(String taxCode, Boolean isPayer, + Boolean isDebtor, String continuationToken, Integer size, TransactionListOrder orderBy, Direction ordering) { List listOfTransactionListItem = new ArrayList<>(); + + String columnName = Optional.ofNullable(orderBy).map(o -> o.getColumnName()).orElse("transactionDate"); + String direction = Optional.ofNullable(ordering).map(Enum::name).orElse(Sort.Direction.DESC.name()); - final Sort sort = Sort.by(Sort.Direction.DESC, "transactionDate"); + final Sort sort = Sort.by(Sort.Direction.fromString(direction), columnName); final CosmosPageRequest pageRequest = new CosmosPageRequest(0, size, continuationToken, sort); - final Page page = this.bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(taxCode, pageRequest); + final Page page = this.bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(taxCode, isPayer, isDebtor, pageRequest); Set set = new HashSet<>(page.getContent().size()); List listOfViewUser = page.getContent().stream() .sorted(Comparator.comparing(BizEventsViewUser::getIsDebtor,Comparator.reverseOrder())) .filter(p -> set.add(p.getTransactionId())).toList(); if(listOfViewUser.isEmpty()){ - throw new AppException(AppError.VIEW_USER_NOT_FOUND_WITH_TAX_CODE, taxCode); + throw new AppException(AppError.VIEW_USER_NOT_FOUND_WITH_TAX_CODE_AND_FILTER, taxCode, isPayer, isDebtor); } for (BizEventsViewUser viewUser : listOfViewUser) { List listOfViewCart; @@ -110,13 +114,17 @@ public TransactionListResponse getTransactionList( } @Override - public TransactionListResponse getCachedTransactionList(String taxCode, Integer page, Integer size) { + public TransactionListResponse getCachedTransactionList(String taxCode, Boolean isPayer, + Boolean isDebtor, Integer page, Integer size, TransactionListOrder orderBy, Direction ordering) { List listOfTransactionListItem = new ArrayList<>(); - List> pagedListOfViewUser = this.retrievePaginatedList(taxCode, size, TransactionListOrder.TRANSACTION_DATE, Sort.Direction.DESC); + List> pagedListOfViewUser = this.retrievePaginatedList(taxCode, isPayer, isDebtor, + size, orderBy, ordering); + + List requestedViewUserPage = !CollectionUtils.isEmpty(pagedListOfViewUser) ? pagedListOfViewUser.get(page) : new ArrayList<>(); - for (BizEventsViewUser viewUser : pagedListOfViewUser.get(page)) { + for (BizEventsViewUser viewUser : requestedViewUserPage) { List listOfViewCart; if(Boolean.TRUE.equals(viewUser.getIsPayer())){ listOfViewCart = this.bizEventsViewCartRepository.getBizEventsViewCartByTransactionId(viewUser.getTransactionId()); @@ -176,13 +184,14 @@ public void disableTransaction(String fiscalCode, String transactionId) { bizEventsViewUserRepository.saveAll(listOfViewUser); } - private List> retrievePaginatedList (String taxCode, Integer size, TransactionListOrder order, Direction direction) { + private List> retrievePaginatedList (String taxCode, Boolean isPayer, Boolean isDebtor, + Integer size, TransactionListOrder order, Direction direction) { List> pagedListOfViewUser = null; byte [] data; // read from the REDIS cache for the list if ((data=redisRepository.get(Constants.REDIS_KEY_PREFIX+taxCode)) != null){ List mergedListOfViewUser = SerializationUtils.deserialize(data); - pagedListOfViewUser = Util.getPaginatedList(mergedListOfViewUser, size, order, direction); + pagedListOfViewUser = Util.getPaginatedList(mergedListOfViewUser, isPayer, isDebtor, size, order, direction); } else { List fullListOfViewUser = this.bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(taxCode); if(CollectionUtils.isEmpty(fullListOfViewUser)){ @@ -191,7 +200,7 @@ private List> retrievePaginatedList (String taxCode, Int List mergedListOfViewUser = new ArrayList<>(Util.getMergedListByTID(fullListOfViewUser)); // write in the REDIS cache the paginated list redisRepository.save(Constants.REDIS_KEY_PREFIX+taxCode, SerializationUtils.serialize((Serializable)mergedListOfViewUser), redisTTL); - pagedListOfViewUser = Util.getPaginatedList(mergedListOfViewUser, size, order, direction); + pagedListOfViewUser = Util.getPaginatedList(mergedListOfViewUser, isPayer, isDebtor, size, order, direction); } return pagedListOfViewUser; } diff --git a/src/main/java/it/gov/pagopa/bizeventsservice/util/Util.java b/src/main/java/it/gov/pagopa/bizeventsservice/util/Util.java index 378ad1dc..597aa40b 100644 --- a/src/main/java/it/gov/pagopa/bizeventsservice/util/Util.java +++ b/src/main/java/it/gov/pagopa/bizeventsservice/util/Util.java @@ -17,10 +17,11 @@ public class Util { private Util() {} - public static List> getPaginatedList(List mergedListByTIDOfViewUser, int pageSize, TransactionListOrder order, Direction direction) { - - Util.getSortedList(mergedListByTIDOfViewUser, order, direction); - return Util.getPages(mergedListByTIDOfViewUser, pageSize); + public static List> getPaginatedList(List mergedListByTIDOfViewUser, Boolean isPayer, Boolean isDebtor, + int pageSize, TransactionListOrder order, Direction direction) { + List filteredListOfViewUser = new ArrayList<>(Util.getFilteredList(mergedListByTIDOfViewUser, isPayer, isDebtor)); + Util.getSortedList(filteredListOfViewUser, order, direction); + return Util.getPages(filteredListOfViewUser, pageSize); } @@ -50,37 +51,31 @@ public static List> getPages(Collection c, Integer pageSize) { return pages; } - public static void getSortedList(List mergedListByTIDOfViewUser, TransactionListOrder order, + public static void getSortedList(List listToSort, TransactionListOrder order, Direction direction) { if (TransactionListOrder.TRANSACTION_DATE.equals(order)) { switch (direction) { case ASC: - Collections.sort(mergedListByTIDOfViewUser, Comparator.comparing(BizEventsViewUser::getTransactionDate, + Collections.sort(listToSort, Comparator.comparing(BizEventsViewUser::getTransactionDate, Comparator.nullsLast(Comparator.naturalOrder()))); break; case DESC: default: - Collections.sort(mergedListByTIDOfViewUser, Comparator.comparing(BizEventsViewUser::getTransactionDate, + Collections.sort(listToSort, Comparator.comparing(BizEventsViewUser::getTransactionDate, Comparator.nullsLast(Comparator.naturalOrder())).reversed()); break; } - } else if (TransactionListOrder.TAX_CODE.equals(order)){ - switch (direction) { - case ASC: - Collections.sort(mergedListByTIDOfViewUser, Comparator.comparing(BizEventsViewUser::getTaxCode, - Comparator.nullsLast(Comparator.naturalOrder()))); - break; - case DESC: - default: - Collections.sort(mergedListByTIDOfViewUser, Comparator.comparing(BizEventsViewUser::getTaxCode, - Comparator.nullsLast(Comparator.naturalOrder())).reversed()); - break; - } } else { // the default sorting is by transaction date and DESC direction - Collections.sort(mergedListByTIDOfViewUser, Comparator + Collections.sort(listToSort, Comparator .comparing(BizEventsViewUser::getTransactionDate, Comparator.nullsLast(Comparator.naturalOrder())) .reversed()); } } + + public static List getFilteredList(List listToFilter, Boolean isPayer, Boolean isDebtor) { + return listToFilter.stream() + .filter(u -> (isPayer == null || u.getIsPayer().equals(isPayer)) && (isDebtor == null || u.getIsDebtor().equals(isDebtor))) + .toList(); + } } diff --git a/src/test/java/it/gov/pagopa/bizeventsservice/controller/TransactionControllerTest.java b/src/test/java/it/gov/pagopa/bizeventsservice/controller/TransactionControllerTest.java index a6ffbe6e..22cca91e 100644 --- a/src/test/java/it/gov/pagopa/bizeventsservice/controller/TransactionControllerTest.java +++ b/src/test/java/it/gov/pagopa/bizeventsservice/controller/TransactionControllerTest.java @@ -81,8 +81,8 @@ void setUp() throws IOException { List transactionListItems = Utility.readModelFromFile("biz-events/getTransactionList.json", List.class); TransactionListResponse transactionListResponse = TransactionListResponse.builder().transactionList(transactionListItems).build(); TransactionDetailResponse transactionDetailResponse = Utility.readModelFromFile("biz-events/transactionDetails.json", TransactionDetailResponse.class); - when(transactionService.getTransactionList(eq(VALID_FISCAL_CODE), anyString(), anyInt())).thenReturn(transactionListResponse); - when(transactionService.getCachedTransactionList(eq(VALID_FISCAL_CODE), anyInt(), anyInt())).thenReturn(transactionListResponse); + when(transactionService.getTransactionList(eq(VALID_FISCAL_CODE), any(), any(), anyString(), anyInt(), any(), any())).thenReturn(transactionListResponse); + when(transactionService.getCachedTransactionList(eq(VALID_FISCAL_CODE), any(), any(), anyInt(), anyInt(), any(), any())).thenReturn(transactionListResponse); when(transactionService.getTransactionDetails(anyString(), anyString())).thenReturn(transactionDetailResponse); when(transactionService.getPDFReceipt(anyString(), anyString())).thenReturn(receipt); Attachment attachmentDetail = mock (Attachment.class); @@ -117,7 +117,7 @@ void getListTransactionWithMissingFiscalCodeShouldReturnError() throws Exception @Test void getListTransactionWithInvalidFiscalCodeShouldReturnError() throws Exception { - when(transactionService.getTransactionList(eq(INVALID_FISCAL_CODE), any(), anyInt())).thenAnswer(x -> { + when(transactionService.getTransactionList(eq(INVALID_FISCAL_CODE), any(), any(), any(), anyInt(), any(), any())).thenAnswer(x -> { throw new AppException(AppError.INVALID_FISCAL_CODE, INVALID_FISCAL_CODE); }); mvc.perform(get(LIST_TRANSACTION_PATH) @@ -196,7 +196,7 @@ void getTransactionDisableWithMissingFiscalCodeShouldReturnError() throws Except void getTransactionDisableithInvalidFiscalCodeShouldReturnError() throws Exception { doAnswer(x -> { throw new AppException(AppError.INVALID_FISCAL_CODE, INVALID_FISCAL_CODE); - }).when(transactionService).disableTransaction(anyString(), anyString());; + }).when(transactionService).disableTransaction(anyString(), anyString()); mvc.perform(post(TRANSACTION_DISABLE_PATH) .header(FISCAL_CODE_HEADER_KEY, INVALID_FISCAL_CODE) .contentType(MediaType.APPLICATION_JSON)) diff --git a/src/test/java/it/gov/pagopa/bizeventsservice/service/TransactionServiceTest.java b/src/test/java/it/gov/pagopa/bizeventsservice/service/TransactionServiceTest.java index 6c315801..1d34b28c 100644 --- a/src/test/java/it/gov/pagopa/bizeventsservice/service/TransactionServiceTest.java +++ b/src/test/java/it/gov/pagopa/bizeventsservice/service/TransactionServiceTest.java @@ -10,6 +10,7 @@ import it.gov.pagopa.bizeventsservice.entity.view.BizEventsViewGeneral; import it.gov.pagopa.bizeventsservice.entity.view.BizEventsViewUser; import it.gov.pagopa.bizeventsservice.exception.AppException; +import it.gov.pagopa.bizeventsservice.model.filterandorder.Order.TransactionListOrder; import it.gov.pagopa.bizeventsservice.model.response.Attachment; import it.gov.pagopa.bizeventsservice.model.response.AttachmentsDetailsResponse; import it.gov.pagopa.bizeventsservice.model.response.transaction.*; @@ -29,6 +30,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort.Direction; import org.springframework.http.HttpStatus; import org.springframework.test.context.ContextConfiguration; @@ -99,7 +101,7 @@ void taxCodeWithEventsShouldReturnTransactionList() { Pageable pageable = mock(Pageable.class); when(pageOfViewUser.getPageable()).thenReturn(pageable); when(pageable.next()).thenReturn(pageRequest); - when(bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(eq(ViewGenerator.USER_TAX_CODE_WITH_TX), any())) + when(bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(eq(ViewGenerator.USER_TAX_CODE_WITH_TX), any(), any(), any())) .thenReturn(pageOfViewUser); List listOfViewCart = Collections.singletonList(ViewGenerator.generateBizEventsViewCart()); when(bizEventsViewCartRepository.getBizEventsViewCartByTransactionIdAndFilteredByTaxCode( @@ -108,7 +110,7 @@ void taxCodeWithEventsShouldReturnTransactionList() { TransactionListResponse transactionListResponse = Assertions.assertDoesNotThrow(() -> transactionService.getTransactionList( - ViewGenerator.USER_TAX_CODE_WITH_TX, CONTINUATION_TOKEN, PAGE_SIZE)); + ViewGenerator.USER_TAX_CODE_WITH_TX, null, null, CONTINUATION_TOKEN, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.DESC)); Assertions.assertEquals(CONTINUATION_TOKEN, transactionListResponse.getContinuationToken()); List transactionListItems = transactionListResponse.getTransactionList(); Assertions.assertNotNull(transactionListItems); @@ -120,7 +122,7 @@ void taxCodeWithEventsShouldReturnTransactionList() { Assertions.assertEquals(listOfViewCart.get(0).getPayee().getTaxCode(), listItem.getPayeeTaxCode()); } - verify(bizEventsViewUserRepository).getBizEventsViewUserByTaxCode(eq(ViewGenerator.USER_TAX_CODE_WITH_TX), any()); + verify(bizEventsViewUserRepository).getBizEventsViewUserByTaxCode(eq(ViewGenerator.USER_TAX_CODE_WITH_TX), any(), any(), any()); verifyNoMoreInteractions(bizEventsViewUserRepository); } @@ -134,7 +136,7 @@ void taxCodeWithEventsAndMultipleCartItemsShouldReturnTransactionList() { Pageable pageable = mock(Pageable.class); when(pageOfViewUser.getPageable()).thenReturn(pageable); when(pageable.next()).thenReturn(pageRequest); - when(bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(eq(ViewGenerator.USER_TAX_CODE_WITH_TX), any())) + when(bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(eq(ViewGenerator.USER_TAX_CODE_WITH_TX), any(), any(), any())) .thenReturn(pageOfViewUser); List listOfViewCart = ViewGenerator.generateListOfFiveViewCart(); when(bizEventsViewCartRepository.getBizEventsViewCartByTransactionIdAndFilteredByTaxCode( @@ -143,7 +145,7 @@ void taxCodeWithEventsAndMultipleCartItemsShouldReturnTransactionList() { TransactionListResponse transactionListResponse = Assertions.assertDoesNotThrow(() -> transactionService.getTransactionList( - ViewGenerator.USER_TAX_CODE_WITH_TX, CONTINUATION_TOKEN, PAGE_SIZE)); + ViewGenerator.USER_TAX_CODE_WITH_TX, null, null, CONTINUATION_TOKEN, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.DESC)); Assertions.assertEquals(CONTINUATION_TOKEN, transactionListResponse.getContinuationToken()); List transactionListItems = transactionListResponse.getTransactionList(); Assertions.assertNotNull(transactionListItems); @@ -157,7 +159,7 @@ void taxCodeWithEventsAndMultipleCartItemsShouldReturnTransactionList() { Assertions.assertEquals("", listItem.getPayeeTaxCode()); } - verify(bizEventsViewUserRepository).getBizEventsViewUserByTaxCode(eq(ViewGenerator.USER_TAX_CODE_WITH_TX), any()); + verify(bizEventsViewUserRepository).getBizEventsViewUserByTaxCode(eq(ViewGenerator.USER_TAX_CODE_WITH_TX), any(), any(), any()); verifyNoMoreInteractions(bizEventsViewUserRepository); } @@ -322,7 +324,7 @@ void transactionViewUserNotFoundThrowError() { } @Test - void notCachedTaxCodeWithEventsShouldReturnTransactionList() { + void notCachedTaxCodeWithEventsShouldReturnTransactionListDESC() { List listOfViewUser = ViewGenerator.generateListOf95MixedBizEventsViewUser(); when(bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(ViewGenerator.USER_TAX_CODE_WITH_TX)).thenReturn(listOfViewUser); List listOfSingleViewCart = Collections.singletonList(ViewGenerator.generateBizEventsViewCart()); @@ -335,11 +337,11 @@ void notCachedTaxCodeWithEventsShouldReturnTransactionList() { when(redisRepository.get(anyString())).thenReturn(null); - // invoke service to get first page + // invoke service to get first page - DESC ORDER TransactionListResponse transactionListResponse = Assertions.assertDoesNotThrow(() -> transactionService.getCachedTransactionList( - ViewGenerator.USER_TAX_CODE_WITH_TX, PAGE_NUMBER, PAGE_SIZE)); + ViewGenerator.USER_TAX_CODE_WITH_TX, null, null, PAGE_NUMBER, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.DESC)); Assertions.assertEquals(PAGE_NUMBER, transactionListResponse.getPageInfo().getPage()); Assertions.assertEquals(18, transactionListResponse.getPageInfo().getTotalPages()); Assertions.assertEquals(PAGE_SIZE, transactionListResponse.getPageInfo().getLimit()); @@ -349,11 +351,11 @@ void notCachedTaxCodeWithEventsShouldReturnTransactionList() { Assertions.assertEquals(5, transactionListItems.size()); Assertions.assertEquals("2024-06-12T11:07:46Z", transactionListItems.get(0).getTransactionDate()); - // invoke service to get last page + // invoke service to get last page - DESC ORDER transactionListResponse = Assertions.assertDoesNotThrow(() -> transactionService.getCachedTransactionList( - ViewGenerator.USER_TAX_CODE_WITH_TX, 17, PAGE_SIZE)); + ViewGenerator.USER_TAX_CODE_WITH_TX, null, null, 17, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.DESC)); Assertions.assertEquals(17, transactionListResponse.getPageInfo().getPage()); Assertions.assertEquals(18, transactionListResponse.getPageInfo().getTotalPages()); Assertions.assertEquals(PAGE_SIZE, transactionListResponse.getPageInfo().getLimit()); @@ -362,9 +364,84 @@ void notCachedTaxCodeWithEventsShouldReturnTransactionList() { Assertions.assertNotNull(transactionListItems); Assertions.assertEquals(3, transactionListItems.size()); Assertions.assertEquals("2024-06-07T11:07:46Z", transactionListItems.get(2).getTransactionDate()); - + verify(bizEventsViewUserRepository, times(2)).getBizEventsViewUserByTaxCode(ViewGenerator.USER_TAX_CODE_WITH_TX); verifyNoMoreInteractions(bizEventsViewUserRepository); + + } + + @Test + void notCachedTaxCodeWithEventsShouldReturnTransactionListASC() { + List listOfViewUser = ViewGenerator.generateListOf95MixedBizEventsViewUser(); + when(bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(ViewGenerator.USER_TAX_CODE_WITH_TX)).thenReturn(listOfViewUser); + List listOfSingleViewCart = Collections.singletonList(ViewGenerator.generateBizEventsViewCart()); + List listOfMultiViewCart = ViewGenerator.generateListOfFiveViewCart(); + when(bizEventsViewCartRepository.getBizEventsViewCartByTransactionIdAndFilteredByTaxCode(contains("_cart_"), eq(ViewGenerator.USER_TAX_CODE_WITH_TX))) + .thenReturn(listOfMultiViewCart); + when(bizEventsViewCartRepository.getBizEventsViewCartByTransactionIdAndFilteredByTaxCode(contains("_nocart"), eq(ViewGenerator.USER_TAX_CODE_WITH_TX))) + .thenReturn(listOfSingleViewCart); + // taxcode is not in cache + when(redisRepository.get(anyString())).thenReturn(null); + + // invoke service to get first page - ASC ORDER + TransactionListResponse transactionListResponse = + Assertions.assertDoesNotThrow(() -> + transactionService.getCachedTransactionList( + ViewGenerator.USER_TAX_CODE_WITH_TX, null, null, PAGE_NUMBER, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.ASC)); + Assertions.assertEquals(PAGE_NUMBER, transactionListResponse.getPageInfo().getPage()); + Assertions.assertEquals(18, transactionListResponse.getPageInfo().getTotalPages()); + Assertions.assertEquals(PAGE_SIZE, transactionListResponse.getPageInfo().getLimit()); + Assertions.assertEquals(88, transactionListResponse.getPageInfo().getItemsFound()); + List transactionListItems = transactionListResponse.getTransactionList(); + Assertions.assertNotNull(transactionListItems); + Assertions.assertEquals(5, transactionListItems.size()); + Assertions.assertEquals("2024-06-07T11:07:46Z", transactionListItems.get(0).getTransactionDate()); + + // invoke service to get last page - ASC ORDER + transactionListResponse = + Assertions.assertDoesNotThrow(() -> + transactionService.getCachedTransactionList( + ViewGenerator.USER_TAX_CODE_WITH_TX, null, null, 17, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.ASC)); + Assertions.assertEquals(17, transactionListResponse.getPageInfo().getPage()); + Assertions.assertEquals(18, transactionListResponse.getPageInfo().getTotalPages()); + Assertions.assertEquals(PAGE_SIZE, transactionListResponse.getPageInfo().getLimit()); + Assertions.assertEquals(88, transactionListResponse.getPageInfo().getItemsFound()); + transactionListItems = transactionListResponse.getTransactionList(); + Assertions.assertNotNull(transactionListItems); + Assertions.assertEquals(3, transactionListItems.size()); + Assertions.assertEquals("2024-06-12T11:07:46Z", transactionListItems.get(2).getTransactionDate()); + + } + + @Test + void notCachedTaxCodeAndFilterWithEventsShouldReturnTransactionList() { + List listOfViewUser = ViewGenerator.generateListOf95MixedBizEventsViewUser(); + when(bizEventsViewUserRepository.getBizEventsViewUserByTaxCode(ViewGenerator.USER_TAX_CODE_WITH_TX)).thenReturn(listOfViewUser); + List listOfSingleViewCart = Collections.singletonList(ViewGenerator.generateBizEventsViewCart()); + List listOfMultiViewCart = ViewGenerator.generateListOfFiveViewCart(); + when(bizEventsViewCartRepository.getBizEventsViewCartByTransactionIdAndFilteredByTaxCode(contains("_cart_"), eq(ViewGenerator.USER_TAX_CODE_WITH_TX))) + .thenReturn(listOfMultiViewCart); + when(bizEventsViewCartRepository.getBizEventsViewCartByTransactionIdAndFilteredByTaxCode(contains("_nocart"), eq(ViewGenerator.USER_TAX_CODE_WITH_TX))) + .thenReturn(listOfSingleViewCart); + // taxcode is not in cache + when(redisRepository.get(anyString())).thenReturn(null); + + + // invoke service to get all notices with isPayer = true + TransactionListResponse transactionListResponse = + Assertions.assertDoesNotThrow(() -> + transactionService.getCachedTransactionList( + ViewGenerator.USER_TAX_CODE_WITH_TX, Boolean.TRUE, null, PAGE_NUMBER, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.DESC)); + Assertions.assertEquals(PAGE_NUMBER, transactionListResponse.getPageInfo().getPage()); + Assertions.assertEquals(0, transactionListResponse.getPageInfo().getTotalPages()); + Assertions.assertEquals(PAGE_SIZE, transactionListResponse.getPageInfo().getLimit()); + Assertions.assertEquals(0, transactionListResponse.getPageInfo().getItemsFound()); + List transactionListItems = transactionListResponse.getTransactionList(); + Assertions.assertNotNull(transactionListItems); + Assertions.assertEquals(0, transactionListItems.size()); + + verify(bizEventsViewUserRepository, times(1)).getBizEventsViewUserByTaxCode(ViewGenerator.USER_TAX_CODE_WITH_TX); + verifyNoMoreInteractions(bizEventsViewUserRepository); } @Test @@ -387,7 +464,7 @@ void cachedTaxCodeWithEventsShouldReturnTransactionList() { TransactionListResponse transactionListResponse = Assertions.assertDoesNotThrow(() -> transactionService.getCachedTransactionList( - ViewGenerator.USER_TAX_CODE_WITH_TX, PAGE_NUMBER, PAGE_SIZE)); + ViewGenerator.USER_TAX_CODE_WITH_TX, null, null, PAGE_NUMBER, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.DESC)); Assertions.assertEquals(PAGE_NUMBER, transactionListResponse.getPageInfo().getPage()); Assertions.assertEquals(18, transactionListResponse.getPageInfo().getTotalPages()); Assertions.assertEquals(PAGE_SIZE, transactionListResponse.getPageInfo().getLimit()); @@ -401,7 +478,7 @@ void cachedTaxCodeWithEventsShouldReturnTransactionList() { transactionListResponse = Assertions.assertDoesNotThrow(() -> transactionService.getCachedTransactionList( - ViewGenerator.USER_TAX_CODE_WITH_TX, 17, PAGE_SIZE)); + ViewGenerator.USER_TAX_CODE_WITH_TX, null, null, 17, PAGE_SIZE, TransactionListOrder.TRANSACTION_DATE, Direction.DESC)); Assertions.assertEquals(17, transactionListResponse.getPageInfo().getPage()); Assertions.assertEquals(18, transactionListResponse.getPageInfo().getTotalPages()); Assertions.assertEquals(PAGE_SIZE, transactionListResponse.getPageInfo().getLimit()); diff --git a/src/test/java/it/gov/pagopa/bizeventsservice/util/UtilTest.java b/src/test/java/it/gov/pagopa/bizeventsservice/util/UtilTest.java index af4e21b3..9d5cc615 100644 --- a/src/test/java/it/gov/pagopa/bizeventsservice/util/UtilTest.java +++ b/src/test/java/it/gov/pagopa/bizeventsservice/util/UtilTest.java @@ -22,12 +22,6 @@ void checkListSortingByOrderAndDirection() { Util.getSortedList(mergedListOfViewUser, TransactionListOrder.TRANSACTION_DATE, Direction.DESC); Assertions.assertEquals("2024-06-12T11:07:46Z", mergedListOfViewUser.get(0).getTransactionDate()); // first element Assertions.assertEquals("2024-06-07T11:07:46Z", mergedListOfViewUser.get(mergedListOfViewUser.size()-1).getTransactionDate()); // last element - Util.getSortedList(mergedListOfViewUser, TransactionListOrder.TAX_CODE, Direction.ASC); - Assertions.assertEquals(ViewGenerator.USER_TAX_CODE_WITH_TX, mergedListOfViewUser.get(0).getTaxCode()); // first element - Assertions.assertEquals(ViewGenerator.USER_TAX_CODE_WITH_TX, mergedListOfViewUser.get(mergedListOfViewUser.size()-1).getTaxCode()); // last element - Util.getSortedList(mergedListOfViewUser, TransactionListOrder.TAX_CODE, Direction.DESC); - Assertions.assertEquals(ViewGenerator.USER_TAX_CODE_WITH_TX, mergedListOfViewUser.get(0).getTaxCode()); // first element - Assertions.assertEquals(ViewGenerator.USER_TAX_CODE_WITH_TX, mergedListOfViewUser.get(mergedListOfViewUser.size()-1).getTaxCode()); // last element } }