Skip to content

Commit b4e53af

Browse files
authored
PN-16509: changed code from 400.02 to 400.09 for consolidatore duplic… (#665)
* PN-16509: changed code from 400.02 to 400.09 for consolidatore duplicatedRequest * PN-16509: changed code from 400.02 to 400.09 for consolidatore duplicatedRequest * PN-16509: fix code string
1 parent 2e0a194 commit b4e53af

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

docs/openapi/external/consolidatore-v1.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ paths:
157157
syntaxError:
158158
summary: 'Errore sintattico'
159159
value: { resultCode: '400.01', resultDescription: 'Syntax Error', errorList: [ 'field requestId is required'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
160-
semanticError:
160+
semanticError:
161161
summary: 'Errore semantico'
162162
value: { resultCode: '400.02', resultDescription: 'Semantic Error', errorList: [ 'unrecognized product Type'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
163163
schema:
@@ -266,7 +266,7 @@ webhooks:
266266
value: { resultCode: '400.01', resultDescription: 'Syntax Error', errorList: [ 'field requestId is required'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
267267
semanticError:
268268
summary: 'Errore semantico'
269-
value: { resultCode: '400.02', resultDescription: 'Semantic Error', errorList: [ 'unrecognized product Type'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
269+
value: { resultCode: '400.02', resultDescription: 'Semantic Error', errorList: [ 'unrecognized product Type'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
270270
'401':
271271
description: >-
272272
Il sistema chiamante non è stato identificato, verificare le configurazioni
@@ -316,7 +316,7 @@ webhooks:
316316
value: { resultCode: '400.01', resultDescription: 'Syntax Error', errorList: [ 'field requestId is required'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
317317
semanticError:
318318
summary: 'Errore semantico'
319-
value: { resultCode: '400.02', resultDescription: 'Semantic Error', errorList: [ 'unrecognized product Type'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
319+
value: { resultCode: '400.02', resultDescription: 'Semantic Error', errorList: [ 'unrecognized product Type'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
320320
'401':
321321
description: >-
322322
Il sistema chiamante non è stato identificato, verificare le configurazioni
@@ -378,7 +378,7 @@ webhooks:
378378
value: { resultCode: '400.01', resultDescription: 'Syntax Error', errorList: [ 'field requestId is required'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
379379
semanticError:
380380
summary: 'Errore semantico'
381-
value: { resultCode: '400.02', resultDescription: 'Semantic Error', errorList: [ 'unrecognized product Type'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
381+
value: { resultCode: '400.02', resultDescription: 'Semantic Error', errorList: [ 'unrecognized product Type'], clientResponseTimeStamp: '2019-08-24T14:15:22Z'}
382382

383383
# Path /consolidatore-ingress/v1/get-attachment/{fileKey}
384384
get-attachment:

src/main/java/it/pagopa/pn/ec/consolidatore/service/impl/RicezioneEsitiCartaceoServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public Mono<RequestDto> verificaDuplicati(RequestDto requestDto, ConsolidatoreIn
288288
if (Boolean.FALSE.equals(isDuplicated)) {
289289
sink.next(requestDto);
290290
} else {
291-
sink.error(new RicezioneEsitiCartaceoException("400.02", errorCodeDescriptionMap().get(SEMANTIC_ERROR_CODE), List.of(DUPLICATED_EVENT),
291+
sink.error(new RicezioneEsitiCartaceoException(DUPLICATED_REQUEST_CODE, errorCodeDescriptionMap().get(DUPLICATED_REQUEST_ERROR_CODE), List.of(DUPLICATED_EVENT),
292292
List.of(new ConsAuditLogError(ERR_CONS_DUPLICATED_EVENT.getValue(), "The request has duplicated events", requestDto.getRequestIdx()))));
293293
}
294294
});

src/main/java/it/pagopa/pn/ec/consolidatore/utils/PaperResult.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@ private PaperResult() {
2424
public static final String SYNTAX_ERROR_DESCRIPTION = "Errore di validazione sintattica del messaggio";
2525
public static final String SEMANTIC_ERROR_DESCRIPTION = "Errore di validazione regole semantiche";
2626
public static final String REQUEST_ID_ERROR_DESCRIPTION = "requestId mai ricevuto";
27+
public static final String DUPLICATED_REQUEST_ERROR_DESCRIPTION = "Errore richiesta duplicata";
2728

2829
// STATUS CODES
2930
public static final String OK_CODE= "200.00";
3031
public static final String SYNTAX_ERROR_CODE = "400.01";
3132
public static final String SEMANTIC_ERROR_CODE = "400.02";
3233
public static final String REQUEST_ID_ERROR_CODE = "404.00";
34+
public static final String DUPLICATED_REQUEST_ERROR_CODE = "400.09";
3335
public static final String AUTHENTICATION_ERROR_CODE = "401.00";
3436
public static final String DUPLICATED_REQUEST_CODE = "409.00";
3537
public static final String INTERNAL_SERVER_ERROR_CODE = "500.00";
3638

3739
private static final Map<String, String> errorCodeDescriptionMap = Map.ofEntries(
3840
Map.entry(SYNTAX_ERROR_CODE, SYNTAX_ERROR_DESCRIPTION),
3941
Map.entry(SEMANTIC_ERROR_CODE, SEMANTIC_ERROR_DESCRIPTION),
42+
Map.entry(DUPLICATED_REQUEST_ERROR_CODE, DUPLICATED_REQUEST_ERROR_DESCRIPTION),
4043
Map.entry(REQUEST_ID_ERROR_CODE, REQUEST_ID_ERROR_DESCRIPTION),
4144
Map.entry(INTERNAL_SERVER_ERROR_CODE, INTERNAL_SERVER_ERROR)
4245
);
@@ -45,12 +48,13 @@ private PaperResult() {
4548
(
4649
Map.entry(SYNTAX_ERROR_CODE, SYNTAX_ERROR),
4750
Map.entry(SEMANTIC_ERROR_CODE, SEMANTIC_ERROR),
51+
Map.entry(DUPLICATED_REQUEST_ERROR_CODE, DUPLICATED_REQUEST),
4852
Map.entry(AUTHENTICATION_ERROR_CODE, AUTHENTICATION_ERROR),
4953
Map.entry(DUPLICATED_REQUEST_CODE, DUPLICATED_REQUEST),
5054
Map.entry(OK_CODE, SENT.getStatusTransactionTableCompliant())
5155
);
5256

53-
public static final List<String> TO_ACK_STATUS_CODES = List.of(SYNTAX_ERROR_CODE, SEMANTIC_ERROR_CODE, DUPLICATED_REQUEST_CODE);
57+
public static final List<String> TO_ACK_STATUS_CODES = List.of(SYNTAX_ERROR_CODE, SEMANTIC_ERROR_CODE, DUPLICATED_REQUEST_ERROR_DESCRIPTION, DUPLICATED_REQUEST_CODE);
5458
public static final List<String> TO_DLQ_STATUS_CODES = List.of(AUTHENTICATION_ERROR_CODE, REQUEST_ID_ERROR_CODE);
5559

5660
public static Map<String, String> errorCodeDescriptionMap() {

0 commit comments

Comments
 (0)