From 61c997edaabfeed03b2b530497f8316c8a22aaad Mon Sep 17 00:00:00 2001
From: Andrea De Rinaldis <117269497+andrea-deri@users.noreply.github.com>
Date: Fri, 5 Apr 2024 13:01:33 +0200
Subject: [PATCH] [NOD-784] fix: reverted package imports (#8)
Co-authored-by: maxsca <130107847+maxsca@users.noreply.github.com>
---
openapi/openapi.json | 237 ++++++++----------
pom.xml | 44 ++--
.../client/APIConfigCacheClientConfig.java | 5 +-
.../config/client/CheckoutClientConfig.java | 5 +-
.../client/DecouplerCachingClientConfig.java | 5 +-
.../config/client/GpdClientConfig.java | 5 +-
.../client/IuvGeneratorClientConfig.java | 5 +-
.../advice/GlobalExceptionHandler.java | 101 --------
.../wispconverter/service/CacheService.java | 8 +-
.../service/CheckoutService.java | 23 +-
.../service/ConfigCacheService.java | 11 +-
.../service/DebtPositionService.java | 51 ++--
.../service/mapper/CartMapper.java | 6 +-
.../service/mapper/DebtPositionMapper.java | 11 +-
14 files changed, 183 insertions(+), 334 deletions(-)
diff --git a/openapi/openapi.json b/openapi/openapi.json
index 7f6b6df4..0b220c3b 100644
--- a/openapi/openapi.json
+++ b/openapi/openapi.json
@@ -1,170 +1,151 @@
{
- "openapi": "3.0.1",
- "info": {
- "description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing",
- "termsOfService": "https://www.pagopa.gov.it/",
- "title": "wisp-converter",
- "version": "0.0.6"
+ "openapi" : "3.0.1",
+ "info" : {
+ "description" : "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.\n\n**STANDARD ERRORS:**\nNAME | CODE | DESCRIPTION\n- | - | -\n**WIC-500** | *ERROR* | *...error description...*\n**WIC-1000** | *GENERIC_ERROR* | Error while executing conversion flow. *...error description...*\n**WIC-1001** | *PARSING_GENERIC_ERROR* | Error while parsing payload. *...error description...*\n**WIC-1002** | *PARSING_INVALID_HEADER* | Error while parsing payload. The SOAP header in payload is invalid: *...error description...*\n**WIC-1003** | *PARSING_INVALID_BODY* | Error while parsing payload. The SOAP body in payload is invalid: *...error description...*\n**WIC-1004** | *PARSING_INVALID_XML_NODES* | Error while parsing payload. The list of nodes extracted from document must be greater than zero, but currently it is zero.\n**WIC-1005** | *PARSING_INVALID_ZIPPED_PAYLOAD* | Error while parsing payload. Cannot unzip payload correctly.\n**WIC-1006** | *PARSING_PRIMITIVE_NOT_VALID* | Error while checking primitive. Primitive [*...content...*] not valid.\n**WIC-1100** | *VALIDATION_INVALID_MULTIBENEFICIARY_CART* | Error while generating debt position for GPD service. The cart is defined as multi-beneficiary but there are a number of RPTs lower than 2.\n**WIC-1101** | *VALIDATION_INVALID_IBANS* | Error while generating debt position for GPD service. The IBAN field must be set if digital stamp is not defined for the transfer.\n**WIC-1102** | *VALIDATION_INVALID_DEBTOR* | Error while generating debt position for GPD service. The debtor subject information is different between the various RPT of the cart.\n**WIC-1103** | *VALIDATION_INVALID_CREDITOR_INSTITUTION* | Error while generating debt position for GPD service. The creditor institution information is different between the various RPT of the cart.\n**WIC-1200** | *CONFIGURATION_INVALID_STATION* | Error while generating cart for Checkout service. No valid station found with code [*...content...*].\n**WIC-1201** | *CONFIGURATION_INVALID_STATION_REDIRECT_URL* | Error while generating cart for Checkout service. The station with code [*...content...*] contains wrong redirect URL and it is not possible to generate valid URI.\n**WIC-2000** | *PERSISTENCE_RPT_NOT_FOUND* | Error while retrieving RPT. RPT with sessionId [*...content...*] not found.\n**WIC-2001** | *PERSISTENCE_REQUESTID_CACHING_ERROR* | Error while caching RequestID. *...error description...*\n**WIC-3000** | *CLIENT_APICONFIGCACHE* | Error while communicating with APIConfig cache service. *...error description...*\n**WIC-3001** | *CLIENT_GPD* | Error while communicating with GPD service. *...error description...*\n**WIC-3002** | *CLIENT_IUVGENERATOR* | Error while communicating with IUV Generator service. *...error description...*\n**WIC-3003** | *CLIENT_DECOUPLER_CACHING* | Error while communicating with decoupler caching API. *...error description...*\n**WIC-3004** | *CLIENT_CHECKOUT* | Error while communicating with Checkout service. *...error description...*\n**WIC-3005** | *CLIENT_CHECKOUT_NO_REDIRECT_LOCATION* | Error while communicating with Checkout service. No valid 'Location' header was found,\n**WIC-3006** | *CLIENT_CHECKOUT_INVALID_REDIRECT_LOCATION* | Error while communicating with Checkout service. An empty 'Location' header was found.\n",
+ "termsOfService" : "https://www.pagopa.gov.it/",
+ "title" : "WISP Converter",
+ "version" : "0.0.6"
},
- "servers": [
- {
- "url": "http://localhost",
- "description": "Generated server url"
- }
- ],
- "tags": [
- {
- "description": "Application info APIs",
- "name": "Home"
- },
- {
- "description": "Conversion and redirection APIs",
- "name": "Redirect"
- }
- ],
- "paths": {
- "/info": {
- "get": {
- "operationId": "healthCheck",
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/AppInfoResponse"
+ "servers" : [ {
+ "url" : "http://localhost",
+ "description" : "Generated server url"
+ } ],
+ "tags" : [ {
+ "description" : "Application info APIs",
+ "name" : "Home"
+ }, {
+ "description" : "Conversion and redirection APIs",
+ "name" : "Redirect"
+ } ],
+ "paths" : {
+ "/info" : {
+ "get" : {
+ "operationId" : "healthCheck",
+ "responses" : {
+ "200" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/AppInfoResponse"
}
}
},
- "description": "OK.",
- "headers": {
- "X-Request-Id": {
- "description": "This header identifies the call",
- "schema": {
- "type": "string"
+ "description" : "OK.",
+ "headers" : {
+ "X-Request-Id" : {
+ "description" : "This header identifies the call",
+ "schema" : {
+ "type" : "string"
}
}
}
}
},
- "security": [
- {
- "ApiKey": []
- }
- ],
- "summary": "Return OK if application is started",
- "tags": [
- "Home"
- ]
+ "security" : [ {
+ "ApiKey" : [ ]
+ } ],
+ "summary" : "Return OK if application is started",
+ "tags" : [ "Home" ]
},
- "parameters": [
- {
- "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.",
- "in": "header",
- "name": "X-Request-Id",
- "schema": {
- "type": "string"
- }
+ "parameters" : [ {
+ "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.",
+ "in" : "header",
+ "name" : "X-Request-Id",
+ "schema" : {
+ "type" : "string"
}
- ]
+ } ]
},
- "/redirect": {
- "get": {
- "operationId": "redirect_1",
- "parameters": [
- {
- "example": "identificativoIntermediarioPA_sessionId",
- "in": "query",
- "name": "sessionId",
- "required": true,
- "schema": {
- "type": "string"
- }
+ "/redirect" : {
+ "get" : {
+ "operationId" : "redirect_1",
+ "parameters" : [ {
+ "example" : "identificativoIntermediarioPA_sessionId",
+ "in" : "query",
+ "name" : "sessionId",
+ "required" : true,
+ "schema" : {
+ "type" : "string"
}
- ],
- "responses": {
- "200": {
- "content": {
- "*/*": {
- "schema": {
- "$ref": "#/components/schemas/RedirectResponse"
+ } ],
+ "responses" : {
+ "200" : {
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/RedirectResponse"
}
}
},
- "description": "Redirect info to Checkout service.",
- "headers": {
- "X-Request-Id": {
- "description": "This header identifies the call",
- "schema": {
- "type": "string"
+ "description" : "Redirect info to Checkout service.",
+ "headers" : {
+ "X-Request-Id" : {
+ "description" : "This header identifies the call",
+ "schema" : {
+ "type" : "string"
}
}
}
},
- "302": {
- "description": "Redirect to Checkout service.",
- "headers": {
- "X-Request-Id": {
- "description": "This header identifies the call",
- "schema": {
- "type": "string"
+ "302" : {
+ "description" : "Redirect to Checkout service.",
+ "headers" : {
+ "X-Request-Id" : {
+ "description" : "This header identifies the call",
+ "schema" : {
+ "type" : "string"
}
}
}
}
},
- "security": [
- {
- "ApiKey": []
- }
- ],
- "tags": [
- "Redirect"
- ]
+ "security" : [ {
+ "ApiKey" : [ ]
+ } ],
+ "tags" : [ "Redirect" ]
},
- "parameters": [
- {
- "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.",
- "in": "header",
- "name": "X-Request-Id",
- "schema": {
- "type": "string"
- }
+ "parameters" : [ {
+ "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.",
+ "in" : "header",
+ "name" : "X-Request-Id",
+ "schema" : {
+ "type" : "string"
}
- ]
+ } ]
}
},
- "components": {
- "schemas": {
- "AppInfoResponse": {
- "type": "object",
- "properties": {
- "environment": {
- "type": "string"
+ "components" : {
+ "schemas" : {
+ "AppInfoResponse" : {
+ "type" : "object",
+ "properties" : {
+ "environment" : {
+ "type" : "string"
},
- "name": {
- "type": "string"
+ "name" : {
+ "type" : "string"
},
- "version": {
- "type": "string"
+ "version" : {
+ "type" : "string"
}
}
},
- "RedirectResponse": {
- "type": "object",
- "properties": {
- "redirect-url": {
- "type": "string"
+ "RedirectResponse" : {
+ "type" : "object",
+ "properties" : {
+ "redirect-url" : {
+ "type" : "string"
}
}
}
},
- "securitySchemes": {
- "ApiKey": {
- "description": "The API key to access this function app.",
- "in": "header",
- "name": "Ocp-Apim-Subscription-Key",
- "type": "apiKey"
+ "securitySchemes" : {
+ "ApiKey" : {
+ "description" : "The API key to access this function app.",
+ "in" : "header",
+ "name" : "Ocp-Apim-Subscription-Key",
+ "type" : "apiKey"
}
}
}
-}
+}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 0d54d411..61b96fe1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,10 +65,6 @@
org.springframework.boot
spring-boot-starter-web-services
-
- org.springframework.boot
- spring-boot-starter-thymeleaf
-
@@ -318,10 +314,10 @@
false
resttemplate
- it.gov.pagopa.wispconverter.client.cache
- it.gov.pagopa.wispconverter.client.cache.model
- it.gov.pagopa.wispconverter.client.cache.api
- it.gov.pagopa.wispconverter.client.cache.invoker
+ it.gov.pagopa.gen.wispconverter.client.cache
+ it.gov.pagopa.gen.wispconverter.client.cache.model
+ it.gov.pagopa.gen.wispconverter.client.cache.api
+ it.gov.pagopa.gen.wispconverter.client.cache.invoker
java8
@@ -339,10 +335,10 @@
false
resttemplate
- it.gov.pagopa.wispconverter.client.gpd
- it.gov.pagopa.wispconverter.client.gpd.model
- it.gov.pagopa.wispconverter.client.gpd.api
- it.gov.pagopa.wispconverter.client.gpd.invoker
+ it.gov.pagopa.gen.wispconverter.client.gpd
+ it.gov.pagopa.gen.wispconverter.client.gpd.model
+ it.gov.pagopa.gen.wispconverter.client.gpd.api
+ it.gov.pagopa.gen.wispconverter.client.gpd.invoker
java8
@@ -360,10 +356,10 @@
false
resttemplate
- it.gov.pagopa.wispconverter.client.iuvgenerator
- it.gov.pagopa.wispconverter.client.iuvgenerator.model
- it.gov.pagopa.wispconverter.client.iuvgenerator.api
- it.gov.pagopa.wispconverter.client.iuvgenerator.invoker
+ it.gov.pagopa.gen.wispconverter.client.iuvgenerator
+ it.gov.pagopa.gen.wispconverter.client.iuvgenerator.model
+ it.gov.pagopa.gen.wispconverter.client.iuvgenerator.api
+ it.gov.pagopa.gen.wispconverter.client.iuvgenerator.invoker
java8
@@ -381,10 +377,10 @@
false
resttemplate
- it.gov.pagopa.wispconverter.client.checkout
- it.gov.pagopa.wispconverter.client.checkout.model
- it.gov.pagopa.wispconverter.client.checkout.api
- it.gov.pagopa.wispconverter.client.checkout.invoker
+ it.gov.pagopa.gen.wispconverter.client.checkout
+ it.gov.pagopa.gen.wispconverter.client.checkout.model
+ it.gov.pagopa.gen.wispconverter.client.checkout.api
+ it.gov.pagopa.gen.wispconverter.client.checkout.invoker
java8
@@ -402,10 +398,10 @@
false
resttemplate
- it.gov.pagopa.wispconverter.client.decouplercaching
- it.gov.pagopa.wispconverter.client.decouplercaching.model
- it.gov.pagopa.wispconverter.client.decouplercaching.api
- it.gov.pagopa.wispconverter.client.decouplercaching.invoker
+ it.gov.pagopa.gen.wispconverter.client.decouplercaching
+ it.gov.pagopa.gen.wispconverter.client.decouplercaching.model
+ it.gov.pagopa.gen.wispconverter.client.decouplercaching.api
+ it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker
java8
diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/client/APIConfigCacheClientConfig.java b/src/main/java/it/gov/pagopa/wispconverter/config/client/APIConfigCacheClientConfig.java
index 869abfc2..c5991ccd 100644
--- a/src/main/java/it/gov/pagopa/wispconverter/config/client/APIConfigCacheClientConfig.java
+++ b/src/main/java/it/gov/pagopa/wispconverter/config/client/APIConfigCacheClientConfig.java
@@ -1,6 +1,5 @@
package it.gov.pagopa.wispconverter.config.client;
-import it.gov.pagopa.wispconverter.client.cache.invoker.ApiClient;
import it.gov.pagopa.wispconverter.service.ReService;
import it.gov.pagopa.wispconverter.util.client.MDCInterceptor;
import it.gov.pagopa.wispconverter.util.client.ReInterceptor;
@@ -62,7 +61,7 @@ public class APIConfigCacheClientConfig {
@Bean
- public ApiClient configCacheClient() {
+ public it.gov.pagopa.gen.wispconverter.client.cache.invoker.ApiClient configCacheClient() {
ApiConfigCacheClientLoggingInterceptor clientLogging = new ApiConfigCacheClientLoggingInterceptor();
clientLogging.setRequestIncludeHeaders(clientRequestIncludeHeaders);
clientLogging.setRequestIncludePayload(clientRequestIncludePayload);
@@ -85,7 +84,7 @@ public ApiClient configCacheClient() {
restTemplate.setErrorHandler(new ApiConfigCacheClientResponseErrorHandler());
- ApiClient client = new ApiClient(restTemplate);
+ it.gov.pagopa.gen.wispconverter.client.cache.invoker.ApiClient client = new it.gov.pagopa.gen.wispconverter.client.cache.invoker.ApiClient(restTemplate);
client.setBasePath(basePath);
// client.setApiKey(apiKey);
diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/client/CheckoutClientConfig.java b/src/main/java/it/gov/pagopa/wispconverter/config/client/CheckoutClientConfig.java
index 5b3b60c9..fdb0b652 100644
--- a/src/main/java/it/gov/pagopa/wispconverter/config/client/CheckoutClientConfig.java
+++ b/src/main/java/it/gov/pagopa/wispconverter/config/client/CheckoutClientConfig.java
@@ -1,6 +1,5 @@
package it.gov.pagopa.wispconverter.config.client;
-import it.gov.pagopa.wispconverter.client.checkout.invoker.ApiClient;
import it.gov.pagopa.wispconverter.service.ReService;
import it.gov.pagopa.wispconverter.util.client.MDCInterceptor;
import it.gov.pagopa.wispconverter.util.client.ReInterceptor;
@@ -62,7 +61,7 @@ public class CheckoutClientConfig {
private boolean clientResponsePretty;
@Bean
- public ApiClient checkoutClient() {
+ public it.gov.pagopa.gen.wispconverter.client.checkout.invoker.ApiClient checkoutClient() {
CheckoutClientLoggingInterceptor clientLogging = new CheckoutClientLoggingInterceptor();
clientLogging.setRequestIncludeHeaders(clientRequestIncludeHeaders);
clientLogging.setRequestIncludePayload(clientRequestIncludePayload);
@@ -85,7 +84,7 @@ public ApiClient checkoutClient() {
restTemplate.setErrorHandler(new CheckoutClientResponseErrorHandler());
- ApiClient client = new ApiClient(restTemplate);
+ it.gov.pagopa.gen.wispconverter.client.checkout.invoker.ApiClient client = new it.gov.pagopa.gen.wispconverter.client.checkout.invoker.ApiClient(restTemplate);
client.setBasePath(basePath);
// client.setApiKey(apiKey);
diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/client/DecouplerCachingClientConfig.java b/src/main/java/it/gov/pagopa/wispconverter/config/client/DecouplerCachingClientConfig.java
index c1dfcb12..3d5b366f 100644
--- a/src/main/java/it/gov/pagopa/wispconverter/config/client/DecouplerCachingClientConfig.java
+++ b/src/main/java/it/gov/pagopa/wispconverter/config/client/DecouplerCachingClientConfig.java
@@ -1,6 +1,5 @@
package it.gov.pagopa.wispconverter.config.client;
-import it.gov.pagopa.wispconverter.client.decouplercaching.invoker.ApiClient;
import it.gov.pagopa.wispconverter.service.ReService;
import it.gov.pagopa.wispconverter.util.client.MDCInterceptor;
import it.gov.pagopa.wispconverter.util.client.ReInterceptor;
@@ -61,7 +60,7 @@ public class DecouplerCachingClientConfig {
private boolean clientResponsePretty;
@Bean
- public ApiClient decouplerCachingClient() {
+ public it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient() {
DecouplerCachingClientLoggingInterceptor clientLogging = new DecouplerCachingClientLoggingInterceptor();
clientLogging.setRequestIncludeHeaders(clientRequestIncludeHeaders);
clientLogging.setRequestIncludePayload(clientRequestIncludePayload);
@@ -84,7 +83,7 @@ public ApiClient decouplerCachingClient() {
restTemplate.setErrorHandler(new DecouplerCachingClientResponseErrorHandler());
- ApiClient client = new ApiClient(restTemplate);
+ it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient client = new it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient(restTemplate);
client.setBasePath(basePath);
client.setApiKey(apiKey);
diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/client/GpdClientConfig.java b/src/main/java/it/gov/pagopa/wispconverter/config/client/GpdClientConfig.java
index c2af6545..0b2304a1 100644
--- a/src/main/java/it/gov/pagopa/wispconverter/config/client/GpdClientConfig.java
+++ b/src/main/java/it/gov/pagopa/wispconverter/config/client/GpdClientConfig.java
@@ -1,6 +1,5 @@
package it.gov.pagopa.wispconverter.config.client;
-import it.gov.pagopa.wispconverter.client.gpd.invoker.ApiClient;
import it.gov.pagopa.wispconverter.service.ReService;
import it.gov.pagopa.wispconverter.util.client.MDCInterceptor;
import it.gov.pagopa.wispconverter.util.client.ReInterceptor;
@@ -61,7 +60,7 @@ public class GpdClientConfig {
private boolean clientResponsePretty;
@Bean
- public ApiClient gpdClient() {
+ public it.gov.pagopa.gen.wispconverter.client.gpd.invoker.ApiClient gpdClient() {
GpdClientLoggingInterceptor clientLogging = new GpdClientLoggingInterceptor();
clientLogging.setRequestIncludeHeaders(clientRequestIncludeHeaders);
clientLogging.setRequestIncludePayload(clientRequestIncludePayload);
@@ -84,7 +83,7 @@ public ApiClient gpdClient() {
restTemplate.setErrorHandler(new GpdClientResponseErrorHandler());
- ApiClient client = new ApiClient(restTemplate);
+ it.gov.pagopa.gen.wispconverter.client.gpd.invoker.ApiClient client = new it.gov.pagopa.gen.wispconverter.client.gpd.invoker.ApiClient(restTemplate);
client.setBasePath(basePath);
client.setApiKey(apiKey);
diff --git a/src/main/java/it/gov/pagopa/wispconverter/config/client/IuvGeneratorClientConfig.java b/src/main/java/it/gov/pagopa/wispconverter/config/client/IuvGeneratorClientConfig.java
index 07fab5d2..7e468e77 100644
--- a/src/main/java/it/gov/pagopa/wispconverter/config/client/IuvGeneratorClientConfig.java
+++ b/src/main/java/it/gov/pagopa/wispconverter/config/client/IuvGeneratorClientConfig.java
@@ -1,6 +1,5 @@
package it.gov.pagopa.wispconverter.config.client;
-import it.gov.pagopa.wispconverter.client.iuvgenerator.invoker.ApiClient;
import it.gov.pagopa.wispconverter.service.ReService;
import it.gov.pagopa.wispconverter.util.client.MDCInterceptor;
import it.gov.pagopa.wispconverter.util.client.ReInterceptor;
@@ -62,7 +61,7 @@ public class IuvGeneratorClientConfig {
@Bean
- public ApiClient iuvGeneratorClient() {
+ public it.gov.pagopa.gen.wispconverter.client.iuvgenerator.invoker.ApiClient iuvGeneratorClient() {
IuvGeneratorClientLoggingInterceptor clientLogging = new IuvGeneratorClientLoggingInterceptor();
clientLogging.setRequestIncludeHeaders(clientRequestIncludeHeaders);
clientLogging.setRequestIncludePayload(clientRequestIncludePayload);
@@ -85,7 +84,7 @@ public ApiClient iuvGeneratorClient() {
restTemplate.setErrorHandler(new IuvGeneratorClientResponseErrorHandler());
- ApiClient client = new ApiClient(restTemplate);
+ it.gov.pagopa.gen.wispconverter.client.iuvgenerator.invoker.ApiClient client = new it.gov.pagopa.gen.wispconverter.client.iuvgenerator.invoker.ApiClient(restTemplate);
client.setBasePath(basePath);
// client.setApiKey(apiKey);
diff --git a/src/main/java/it/gov/pagopa/wispconverter/controller/advice/GlobalExceptionHandler.java b/src/main/java/it/gov/pagopa/wispconverter/controller/advice/GlobalExceptionHandler.java
index d4332561..30f02a47 100644
--- a/src/main/java/it/gov/pagopa/wispconverter/controller/advice/GlobalExceptionHandler.java
+++ b/src/main/java/it/gov/pagopa/wispconverter/controller/advice/GlobalExceptionHandler.java
@@ -66,105 +66,4 @@ protected ResponseEntity