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 handleExceptionInternal(Exception ex, Object bo return super.handleExceptionInternal(ex, body, headers, statusCode, request); } - -// -// @ApiResponses(value = { -// @ApiResponse(responseCode = "500", description = "Internal Server Error", content = { -// @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = ApiErrorResponse.class), examples = {@ExampleObject( -// """ -// { -// "errorId": "68ce8c6a-6d53-486c-97fe-79430d24fb7d", -// "timestamp": "2023-10-09T08:01:39.421224Z", -// "httpStatusCode": 500, -// "httpStatusDescription": "Internal Server Error", -// "appErrorCode": "WIC-0500", -// "message": "An unexpected error has occurred. Please contact support" -// } -// """ -// )}) -// }), -// @ApiResponse(responseCode = "400", description = "Bad Request", content = { -// @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = ApiErrorResponse.class), examples = {@ExampleObject( -// """ -// { -// "timestamp": "2023-10-09T07:53:14.077792Z", -// "httpStatusCode": 400, -// "httpStatusDescription": "Bad Request", -// "appErrorCode": "WIC-0400", -// "message": "Bad request", -// "errors": [ -// { -// "message": "Field error in ..." -// } -// ] -// } -// """ -// )}) -// }), -// @ApiResponse(responseCode = "404", description = "Not found", content = { -// @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = ApiErrorResponse.class), examples = {@ExampleObject( -// """ -// { -// "timestamp": "2023-10-09T07:53:43.367312Z", -// "httpStatusCode": 404, -// "httpStatusDescription": "Not Found", -// "appErrorCode": "WIC-0404", -// "message": "Request POST /api/v1/..... not found" -// } -// """ -// )}) -// }) -// }) -// @ExceptionHandler({AppException.class, AppClientException.class}) -// public ResponseEntity handleAppException(AppException appEx) { -// Pair httpStatusApiErrorResponsePair = appErrorUtil.buildApiErrorResponse(appEx, null, null); -// return ResponseEntity.status(httpStatusApiErrorResponsePair.getLeft()) -// .body(httpStatusApiErrorResponsePair.getRight()); -// } -// -// @Override -// protected ResponseEntity handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) { -// List errorMessages = ex.getBindingResult().getAllErrors().stream() -// .map(oe -> ApiErrorResponse.ErrorMessage.builder().message(oe.toString()).build()) -// .collect(Collectors.toList()); -// AppException appEx = new AppException(ex, AppErrorCodeMessageEnum.BAD_REQUEST); -// Pair httpStatusApiErrorResponsePair = appErrorUtil.buildApiErrorResponse(appEx, null, errorMessages); -// return ResponseEntity.status(httpStatusApiErrorResponsePair.getLeft()) -// .body(httpStatusApiErrorResponsePair.getRight()); -// } -// -// @ExceptionHandler(Exception.class) -// public ResponseEntity handleGenericException(Exception ex, WebRequest request) { -// String errorId = UUID.randomUUID().toString(); -// log.error(String.format("ExceptionHandler: ErrorId=[%s] %s", errorId, ex.getMessage()), ex); -// -// AppException appEx = new AppException(ex, AppErrorCodeMessageEnum.ERROR); -// // errorId viene usato solo per i casi di eccezioni non gestite -// Pair httpStatusApiErrorResponsePair = appErrorUtil.buildApiErrorResponse(appEx, errorId, null); -// return ResponseEntity.status(httpStatusApiErrorResponsePair.getLeft()) -// .body(httpStatusApiErrorResponsePair.getRight()); -// } -// -// @ExceptionHandler(ConstraintViolationException.class) -// public final ResponseEntity handleConstraintViolation(ConstraintViolationException ex, WebRequest request) { -// List errorMessages = ex.getConstraintViolations().stream() -// .map(oe -> ApiErrorResponse.ErrorMessage.builder().message(oe.getMessage()).build()) -// .collect(Collectors.toList()); -// AppException appEx = new AppException(ex, AppErrorCodeMessageEnum.BAD_REQUEST); -// Pair httpStatusApiErrorResponsePair = appErrorUtil.buildApiErrorResponse(appEx, null, errorMessages); -// return ResponseEntity.status(httpStatusApiErrorResponsePair.getLeft()) -// .body(httpStatusApiErrorResponsePair.getRight()); -// } -// -// @Override -// protected ResponseEntity handleHttpMessageNotReadable(HttpMessageNotReadableException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) { -// List errorMessages = Stream.of(ex.getCause().getMessage()) -// .map(oe -> ApiErrorResponse.ErrorMessage.builder().message(oe).build()) -// .collect(Collectors.toList()); -// AppException appEx = new AppException(ex, AppErrorCodeMessageEnum.BAD_REQUEST); -// Pair httpStatusApiErrorResponsePair = appErrorUtil.buildApiErrorResponse(appEx, null, errorMessages); -// return ResponseEntity.status(httpStatusApiErrorResponsePair.getLeft()) -// .body(httpStatusApiErrorResponsePair.getRight()); -// } - } diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/CacheService.java b/src/main/java/it/gov/pagopa/wispconverter/service/CacheService.java index d428faef..f22bd152 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/CacheService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/CacheService.java @@ -1,8 +1,6 @@ package it.gov.pagopa.wispconverter.service; import io.lettuce.core.RedisException; -import it.gov.pagopa.wispconverter.client.decouplercaching.api.DefaultApi; -import it.gov.pagopa.wispconverter.client.decouplercaching.model.DecouplerCachingKeysDto; import it.gov.pagopa.wispconverter.exception.AppErrorCodeMessageEnum; import it.gov.pagopa.wispconverter.exception.AppException; import it.gov.pagopa.wispconverter.repository.CacheRepository; @@ -27,7 +25,7 @@ public class CacheService { private static final String CACHING_KEY_TEMPLATE = "wisp_" + COMPOSITE_TWOVALUES_KEY_TEMPLATE; - private final it.gov.pagopa.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient; + private final it.gov.pagopa.gen.wispconverter.client.decouplercaching.invoker.ApiClient decouplerCachingClient; private final CacheRepository cacheRepository; @@ -42,9 +40,9 @@ public void storeRequestMappingInCache(CommonRPTFieldsDTO commonRPTFieldsDTO, St .toList(); // communicating with APIM policy for caching data for decoupler - DecouplerCachingKeysDto decouplerCachingKeys = new DecouplerCachingKeysDto(); + it.gov.pagopa.gen.wispconverter.client.decouplercaching.model.DecouplerCachingKeysDto decouplerCachingKeys = new it.gov.pagopa.gen.wispconverter.client.decouplercaching.model.DecouplerCachingKeysDto(); noticeNumbers.forEach(noticeNumber -> decouplerCachingKeys.addKeysItem(String.format(COMPOSITE_TWOVALUES_KEY_TEMPLATE, idIntermediarioPA, noticeNumber))); - DefaultApi apiInstance = new DefaultApi(decouplerCachingClient); + it.gov.pagopa.gen.wispconverter.client.decouplercaching.api.DefaultApi apiInstance = new it.gov.pagopa.gen.wispconverter.client.decouplercaching.api.DefaultApi(decouplerCachingClient); apiInstance.saveMapping(decouplerCachingKeys, MDC.get(Constants.MDC_REQUEST_ID)); // save in Redis cache the mapping of the request identifier needed for RT generation in next steps diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/CheckoutService.java b/src/main/java/it/gov/pagopa/wispconverter/service/CheckoutService.java index 8c95ef85..751cf7ff 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/CheckoutService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/CheckoutService.java @@ -1,12 +1,5 @@ package it.gov.pagopa.wispconverter.service; -import it.gov.pagopa.wispconverter.client.cache.model.ConfigDataV1Dto; -import it.gov.pagopa.wispconverter.client.cache.model.RedirectDto; -import it.gov.pagopa.wispconverter.client.cache.model.StationDto; -import it.gov.pagopa.wispconverter.client.checkout.api.PaymentRequestsApi; -import it.gov.pagopa.wispconverter.client.checkout.invoker.ApiClient; -import it.gov.pagopa.wispconverter.client.checkout.model.CartRequestDto; -import it.gov.pagopa.wispconverter.client.checkout.model.CartRequestReturnUrlsDto; import it.gov.pagopa.wispconverter.exception.AppErrorCodeMessageEnum; import it.gov.pagopa.wispconverter.exception.AppException; import it.gov.pagopa.wispconverter.service.mapper.CartMapper; @@ -28,7 +21,7 @@ @RequiredArgsConstructor public class CheckoutService { - private final ApiClient checkoutClient; + private final it.gov.pagopa.gen.wispconverter.client.checkout.invoker.ApiClient checkoutClient; private final ConfigCacheService configCacheService; @@ -40,15 +33,15 @@ public String executeCall(CommonRPTFieldsDTO commonRPTFieldsDTO) { try { // execute mapping for Checkout carts invocation - CartRequestDto cart = mapper.toCart(commonRPTFieldsDTO); + it.gov.pagopa.gen.wispconverter.client.checkout.model.CartRequestDto cart = mapper.toCart(commonRPTFieldsDTO); String stationRedirectURL = ""; // FIXME on next API version will be added the stationID so -> getRedirectURL(cart.getStationId()); - CartRequestReturnUrlsDto returnUrls = new CartRequestReturnUrlsDto(); + it.gov.pagopa.gen.wispconverter.client.checkout.model.CartRequestReturnUrlsDto returnUrls = new it.gov.pagopa.gen.wispconverter.client.checkout.model.CartRequestReturnUrlsDto(); returnUrls.setReturnOkUrl(new URI(stationRedirectURL + "/success.html")); returnUrls.setReturnCancelUrl(new URI(stationRedirectURL + "/cancel.html")); returnUrls.setReturnErrorUrl(new URI(stationRedirectURL + "/error.html")); cart.setReturnUrls(returnUrls); - PaymentRequestsApi apiInstance = new PaymentRequestsApi(checkoutClient); + it.gov.pagopa.gen.wispconverter.client.checkout.api.PaymentRequestsApi apiInstance = new it.gov.pagopa.gen.wispconverter.client.checkout.api.PaymentRequestsApi(checkoutClient); ResponseEntity response = apiInstance.postCartsWithHttpInfo(cart); HttpStatusCode status = response.getStatusCode(); @@ -71,13 +64,13 @@ public String executeCall(CommonRPTFieldsDTO commonRPTFieldsDTO) { } private String getRedirectURL(String stationId) { - ConfigDataV1Dto cache = configCacheService.getCache(); - Map stations = cache.getStations(); - StationDto station = stations.get(stationId); + it.gov.pagopa.gen.wispconverter.client.cache.model.ConfigDataV1Dto cache = configCacheService.getCache(); + Map stations = cache.getStations(); + it.gov.pagopa.gen.wispconverter.client.cache.model.StationDto station = stations.get(stationId); if (station == null) { throw new AppException(AppErrorCodeMessageEnum.CONFIGURATION_INVALID_STATION, stationId); } - RedirectDto redirect = station.getRedirect(); + it.gov.pagopa.gen.wispconverter.client.cache.model.RedirectDto redirect = station.getRedirect(); String protocol = redirect.getProtocol() == null ? "http" : redirect.getProtocol().getValue().toLowerCase(); String url = redirect.getIp() + "/" + redirect.getPath(); url = url.replace("//", "/"); diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/ConfigCacheService.java b/src/main/java/it/gov/pagopa/wispconverter/service/ConfigCacheService.java index 402acbe5..3ac7b590 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/ConfigCacheService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/ConfigCacheService.java @@ -1,8 +1,5 @@ package it.gov.pagopa.wispconverter.service; -import it.gov.pagopa.wispconverter.client.cache.api.CacheApi; -import it.gov.pagopa.wispconverter.client.cache.invoker.ApiClient; -import it.gov.pagopa.wispconverter.client.cache.model.ConfigDataV1Dto; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -12,12 +9,12 @@ @RequiredArgsConstructor public class ConfigCacheService { - private final ApiClient configCacheClient; + private final it.gov.pagopa.gen.wispconverter.client.cache.invoker.ApiClient configCacheClient; - private ConfigDataV1Dto configData; + private it.gov.pagopa.gen.wispconverter.client.cache.model.ConfigDataV1Dto configData; - public ConfigDataV1Dto getCache() { + public it.gov.pagopa.gen.wispconverter.client.cache.model.ConfigDataV1Dto getCache() { if (configData == null) { loadCache(); } @@ -27,7 +24,7 @@ public ConfigDataV1Dto getCache() { public void loadCache() { log.info("loadCache from cache api"); try { - CacheApi apiInstance = new CacheApi(configCacheClient); + it.gov.pagopa.gen.wispconverter.client.cache.api.CacheApi apiInstance = new it.gov.pagopa.gen.wispconverter.client.cache.api.CacheApi(configCacheClient); configData = apiInstance.cache(); } catch (Exception e) { log.error("Cannot get cache", e); diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/DebtPositionService.java b/src/main/java/it/gov/pagopa/wispconverter/service/DebtPositionService.java index ccf261d3..78a06595 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/DebtPositionService.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/DebtPositionService.java @@ -1,10 +1,5 @@ package it.gov.pagopa.wispconverter.service; -import it.gov.pagopa.wispconverter.client.gpd.api.DebtPositionsApiApi; -import it.gov.pagopa.wispconverter.client.gpd.model.*; -import it.gov.pagopa.wispconverter.client.iuvgenerator.api.IuvGeneratorApiApi; -import it.gov.pagopa.wispconverter.client.iuvgenerator.model.IuvGenerationModelDto; -import it.gov.pagopa.wispconverter.client.iuvgenerator.model.IuvGenerationModelResponseDto; import it.gov.pagopa.wispconverter.exception.AppErrorCodeMessageEnum; import it.gov.pagopa.wispconverter.exception.AppException; import it.gov.pagopa.wispconverter.service.mapper.DebtPositionMapper; @@ -31,9 +26,9 @@ @RequiredArgsConstructor public class DebtPositionService { - private final it.gov.pagopa.wispconverter.client.gpd.invoker.ApiClient gpdClient; + private final it.gov.pagopa.gen.wispconverter.client.gpd.invoker.ApiClient gpdClient; - private final it.gov.pagopa.wispconverter.client.iuvgenerator.invoker.ApiClient iuvGeneratorClient; + private final it.gov.pagopa.gen.wispconverter.client.iuvgenerator.invoker.ApiClient iuvGeneratorClient; private final DebtPositionMapper mapper; @@ -52,10 +47,10 @@ public void createDebtPositions(CommonRPTFieldsDTO rptContentDTOs) { try { // converting RPTs in single payment position - MultiplePaymentPositionModelDto multiplePaymentPositions = extractPaymentPositions(rptContentDTOs); + it.gov.pagopa.gen.wispconverter.client.gpd.model.MultiplePaymentPositionModelDto multiplePaymentPositions = extractPaymentPositions(rptContentDTOs); // communicating with GPD-core service in order to execute the operation - DebtPositionsApiApi apiInstance = new DebtPositionsApiApi(gpdClient); + it.gov.pagopa.gen.wispconverter.client.gpd.api.DebtPositionsApiApi apiInstance = new it.gov.pagopa.gen.wispconverter.client.gpd.api.DebtPositionsApiApi(gpdClient); apiInstance.createMultiplePositions1(rptContentDTOs.getCreditorInstitutionId(), multiplePaymentPositions, MDC.get(Constants.MDC_REQUEST_ID), true); //FIXME gestire errori di connessione @@ -65,21 +60,21 @@ public void createDebtPositions(CommonRPTFieldsDTO rptContentDTOs) { } } - private MultiplePaymentPositionModelDto extractPaymentPositions(CommonRPTFieldsDTO commonRPTFieldsDTO) { + private it.gov.pagopa.gen.wispconverter.client.gpd.model.MultiplePaymentPositionModelDto extractPaymentPositions(CommonRPTFieldsDTO commonRPTFieldsDTO) { - List paymentPositions; + List paymentPositions; if (Boolean.TRUE.equals(commonRPTFieldsDTO.getIsMultibeneficiary())) { paymentPositions = extractPaymentPositionsForMultibeneficiary(commonRPTFieldsDTO); } else { paymentPositions = extractPaymentPositionsForNonMultibeneficiary(commonRPTFieldsDTO); } - MultiplePaymentPositionModelDto multiplePaymentPosition = new MultiplePaymentPositionModelDto(); + it.gov.pagopa.gen.wispconverter.client.gpd.model.MultiplePaymentPositionModelDto multiplePaymentPosition = new it.gov.pagopa.gen.wispconverter.client.gpd.model.MultiplePaymentPositionModelDto(); multiplePaymentPosition.setPaymentPositions(paymentPositions); return multiplePaymentPosition; } - private List extractPaymentPositionsForMultibeneficiary(CommonRPTFieldsDTO commonRPTFieldsDTO) { + private List extractPaymentPositionsForMultibeneficiary(CommonRPTFieldsDTO commonRPTFieldsDTO) { if (commonRPTFieldsDTO.getRpts().size() < 2) { throw new AppException(AppErrorCodeMessageEnum.VALIDATION_INVALID_MULTIBENEFICIARY_CART); @@ -87,7 +82,7 @@ private List extractPaymentPositionsForMultibeneficiary RPTContentDTO firstRPTContentDTO = commonRPTFieldsDTO.getRpts().get(0); // mapping of transfers - List transfers = new ArrayList<>(); + List transfers = new ArrayList<>(); for (RPTContentDTO rptContentDTO : commonRPTFieldsDTO.getRpts()) { PaymentRequestDTO paymentRequestDTO = rptContentDTO.getRpt(); @@ -108,13 +103,13 @@ private List extractPaymentPositionsForMultibeneficiary .map(rptContentDTO -> rptContentDTO.getRpt().getTransferData().getTotalAmount()) .reduce(BigDecimal.valueOf(0L), BigDecimal::add) .longValue() * 100; - PaymentOptionModelDto paymentOption = mapper.toPaymentOption(firstRPTContentDTO); + it.gov.pagopa.gen.wispconverter.client.gpd.model.PaymentOptionModelDto paymentOption = mapper.toPaymentOption(firstRPTContentDTO); paymentOption.setNav(noticeNumber); paymentOption.setAmount(amount); paymentOption.setTransfer(transfers); // mapping of payment position - PaymentPositionModelDto paymentPosition = mapper.toPaymentPosition(commonRPTFieldsDTO); + it.gov.pagopa.gen.wispconverter.client.gpd.model.PaymentPositionModelDto paymentPosition = mapper.toPaymentPosition(commonRPTFieldsDTO); paymentPosition.setIupd(calculateIUPD(commonRPTFieldsDTO.getCreditorInstitutionId())); paymentPosition.setPaymentOption(List.of(paymentOption)); @@ -128,8 +123,8 @@ private List extractPaymentPositionsForMultibeneficiary return List.of(paymentPosition); } - private List extractPaymentPositionsForNonMultibeneficiary(CommonRPTFieldsDTO commonRPTFieldsDTO) { - List paymentPositions = new LinkedList<>(); + private List extractPaymentPositionsForNonMultibeneficiary(CommonRPTFieldsDTO commonRPTFieldsDTO) { + List paymentPositions = new LinkedList<>(); List paymentNotices = commonRPTFieldsDTO.getPaymentNotices(); @@ -139,7 +134,7 @@ private List extractPaymentPositionsForNonMultibenefici // mapping of transfers int transferIdCounter = 1; - List transfers = new ArrayList<>(); + List transfers = new ArrayList<>(); for (TransferDTO transferDTO : paymentRequestDTO.getTransferData().getTransfer()) { transfers.add(extractPaymentOptionTransfer(transferDTO, null, transferIdCounter)); @@ -151,13 +146,13 @@ private List extractPaymentPositionsForNonMultibenefici // mapping of payment option Long amount = paymentRequestDTO.getTransferData().getTotalAmount().longValue() * 100; - PaymentOptionModelDto paymentOption = mapper.toPaymentOption(rptContentDTO); + it.gov.pagopa.gen.wispconverter.client.gpd.model.PaymentOptionModelDto paymentOption = mapper.toPaymentOption(rptContentDTO); paymentOption.setAmount(amount); paymentOption.setNav(noticeNumber); paymentOption.setTransfer(transfers); // mapping of payment position - PaymentPositionModelDto paymentPosition = mapper.toPaymentPosition(commonRPTFieldsDTO); + it.gov.pagopa.gen.wispconverter.client.gpd.model.PaymentPositionModelDto paymentPosition = mapper.toPaymentPosition(commonRPTFieldsDTO); paymentPosition.setIupd(calculateIUPD(commonRPTFieldsDTO.getCreditorInstitutionId())); paymentPosition.setPaymentOption(List.of(paymentOption)); paymentPositions.add(paymentPosition); @@ -176,13 +171,13 @@ private String getNAVCodeFromIUVGenerator(String creditorInstitutionCode) { String navCode; try { - IuvGenerationModelDto request = new IuvGenerationModelDto(); + it.gov.pagopa.gen.wispconverter.client.iuvgenerator.model.IuvGenerationModelDto request = new it.gov.pagopa.gen.wispconverter.client.iuvgenerator.model.IuvGenerationModelDto(); request.setAuxDigit(this.auxDigit); request.setSegregationCode(this.segregationCode); // communicating with IUV Generator service in order to retrieve response - IuvGeneratorApiApi apiInstance = new IuvGeneratorApiApi(iuvGeneratorClient); - IuvGenerationModelResponseDto response = apiInstance.generateIUV(creditorInstitutionCode, request); + it.gov.pagopa.gen.wispconverter.client.iuvgenerator.api.IuvGeneratorApiApi apiInstance = new it.gov.pagopa.gen.wispconverter.client.iuvgenerator.api.IuvGeneratorApiApi(iuvGeneratorClient); + it.gov.pagopa.gen.wispconverter.client.iuvgenerator.model.IuvGenerationModelResponseDto response = apiInstance.generateIUV(creditorInstitutionCode, request); navCode = response.getIuv(); } catch (RestClientException e) { @@ -191,16 +186,16 @@ private String getNAVCodeFromIUVGenerator(String creditorInstitutionCode) { return navCode; } - private TransferModelDto extractPaymentOptionTransfer(TransferDTO transferDTO, String organizationFiscalCode, int transferIdCounter) { + private it.gov.pagopa.gen.wispconverter.client.gpd.model.TransferModelDto extractPaymentOptionTransfer(TransferDTO transferDTO, String organizationFiscalCode, int transferIdCounter) { // definition of standard transfer metadata - TransferMetadataModelDto transferMetadata = new TransferMetadataModelDto(); + it.gov.pagopa.gen.wispconverter.client.gpd.model.TransferMetadataModelDto transferMetadata = new it.gov.pagopa.gen.wispconverter.client.gpd.model.TransferMetadataModelDto(); transferMetadata.setKey("DatiSpecificiRiscossione"); transferMetadata.setValue(transferDTO.getCategory()); // common definition for the transfer - TransferModelDto transfer = new TransferModelDto(); - transfer.setIdTransfer(TransferModelDto.IdTransferEnum.fromValue(String.valueOf(transferIdCounter))); + it.gov.pagopa.gen.wispconverter.client.gpd.model.TransferModelDto transfer = new it.gov.pagopa.gen.wispconverter.client.gpd.model.TransferModelDto(); + transfer.setIdTransfer(it.gov.pagopa.gen.wispconverter.client.gpd.model.TransferModelDto.IdTransferEnum.fromValue(String.valueOf(transferIdCounter))); transfer.setAmount(transferDTO.getAmount().longValue() * 100); transfer.setRemittanceInformation(transferDTO.getRemittanceInformation()); transfer.setCategory(getTaxonomy(transferDTO)); diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/mapper/CartMapper.java b/src/main/java/it/gov/pagopa/wispconverter/service/mapper/CartMapper.java index c6a93c28..1bb0ca8f 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/mapper/CartMapper.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/mapper/CartMapper.java @@ -1,7 +1,5 @@ package it.gov.pagopa.wispconverter.service.mapper; -import it.gov.pagopa.wispconverter.client.checkout.model.CartRequestDto; -import it.gov.pagopa.wispconverter.client.checkout.model.PaymentNoticeDto; import it.gov.pagopa.wispconverter.service.model.CommonRPTFieldsDTO; import it.gov.pagopa.wispconverter.service.model.PaymentNoticeContentDTO; import org.mapstruct.Mapper; @@ -15,12 +13,12 @@ public interface CartMapper { @Mapping(source = "payerEmail", target = "emailNotice") @Mapping(target = "allCCP", constant = "false") //@Mapping(source = "stationId", target = "stationId") TODO to be added on new API version - CartRequestDto toCart(CommonRPTFieldsDTO commonRPTFieldsDTO); + it.gov.pagopa.gen.wispconverter.client.checkout.model.CartRequestDto toCart(CommonRPTFieldsDTO commonRPTFieldsDTO); @Mapping(source = "noticeNumber", target = "noticeNumber") @Mapping(source = "fiscalCode", target = "fiscalCode") @Mapping(source = "amount", target = "amount") @Mapping(target = "companyName", constant = "null") @Mapping(target = "description", constant = "null") - PaymentNoticeDto toPaymentNotice(PaymentNoticeContentDTO paymentNoticeContentDTO); + it.gov.pagopa.gen.wispconverter.client.checkout.model.PaymentNoticeDto toPaymentNotice(PaymentNoticeContentDTO paymentNoticeContentDTO); } diff --git a/src/main/java/it/gov/pagopa/wispconverter/service/mapper/DebtPositionMapper.java b/src/main/java/it/gov/pagopa/wispconverter/service/mapper/DebtPositionMapper.java index 13c8919b..8e81608a 100644 --- a/src/main/java/it/gov/pagopa/wispconverter/service/mapper/DebtPositionMapper.java +++ b/src/main/java/it/gov/pagopa/wispconverter/service/mapper/DebtPositionMapper.java @@ -1,8 +1,5 @@ package it.gov.pagopa.wispconverter.service.mapper; -import it.gov.pagopa.wispconverter.client.gpd.model.PaymentOptionModelDto; -import it.gov.pagopa.wispconverter.client.gpd.model.PaymentPositionModelDto; -import it.gov.pagopa.wispconverter.client.gpd.model.StampDto; import it.gov.pagopa.wispconverter.service.model.CommonRPTFieldsDTO; import it.gov.pagopa.wispconverter.service.model.DigitalStampDTO; import it.gov.pagopa.wispconverter.service.model.RPTContentDTO; @@ -13,7 +10,7 @@ @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) public interface DebtPositionMapper { - PaymentPositionModelDto toPaymentPosition(RPTContentDTO rptContentDTO); + it.gov.pagopa.gen.wispconverter.client.gpd.model.PaymentPositionModelDto toPaymentPosition(RPTContentDTO rptContentDTO); @Mapping(source = "payerType", target = "type") @Mapping(source = "payerFiscalCode", target = "fiscalCode") @@ -28,7 +25,7 @@ public interface DebtPositionMapper { @Mapping(source = "payerFullName", target = "companyName") @Mapping(target = "validityDate", expression = "java(null)") @Mapping(target = "switchToExpired", constant = "true") - PaymentPositionModelDto toPaymentPosition(CommonRPTFieldsDTO commonRPTFieldsDTO); + it.gov.pagopa.gen.wispconverter.client.gpd.model.PaymentPositionModelDto toPaymentPosition(CommonRPTFieldsDTO commonRPTFieldsDTO); @Mapping(source = "iuv", target = "iuv") @Mapping(target = "description", constant = "-") @@ -36,10 +33,10 @@ public interface DebtPositionMapper { @Mapping(target = "retentionDate", expression = "java(null)") @Mapping(target = "fee", constant = "0L") @Mapping(target = "dueDate", expression = "java(java.time.OffsetDateTime.now().plusDays(1))") - PaymentOptionModelDto toPaymentOption(RPTContentDTO rptContentDTO); + it.gov.pagopa.gen.wispconverter.client.gpd.model.PaymentOptionModelDto toPaymentOption(RPTContentDTO rptContentDTO); @Mapping(target = "hashDocument", expression = "java(new String(digitalStampDTO.getDocumentHash()))") @Mapping(source = "type", target = "stampType") @Mapping(source = "province", target = "provincialResidence") - StampDto toStamp(DigitalStampDTO digitalStampDTO); + it.gov.pagopa.gen.wispconverter.client.gpd.model.StampDto toStamp(DigitalStampDTO digitalStampDTO); }