Skip to content

Commit

Permalink
feat: RE Event registry update (#11)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: maxsca <[email protected]>
  • Loading branch information
andrea-deri and maxsca authored Apr 10, 2024
1 parent 39659c8 commit 4239cad
Show file tree
Hide file tree
Showing 18 changed files with 414 additions and 221 deletions.
237 changes: 109 additions & 128 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
@@ -1,170 +1,151 @@
{
"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.8"
"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.8"
},
"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"
}
}
}
}
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
<artifactId>logback-ecs-encoder</artifactId>
<version>${java-ecs-logging.version}</version>
</dependency>

</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package it.gov.pagopa.wispconverter.repository;

import com.azure.spring.data.cosmos.repository.CosmosRepository;
import it.gov.pagopa.wispconverter.repository.model.ReEventEntity;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface ReEventRepository extends CosmosRepository<ReEventEntity, String> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package it.gov.pagopa.wispconverter.repository.model;

import com.azure.spring.data.cosmos.core.mapping.Container;
import com.azure.spring.data.cosmos.core.mapping.PartitionKey;

import lombok.*;
import org.springframework.data.annotation.Id;
import it.gov.pagopa.wispconverter.repository.model.enumz.*;

import java.time.Instant;

@Container(containerName = "re")
@Data
@Builder(toBuilder = true)
public class ReEventEntity {
//// START KEY
@Id
private String id;

@PartitionKey
private String partitionKey;
//// END KEY

//// START LOGICAL REF
private String requestId; //gruppo, tutte le chiamate fatte con lo stesso X-Request-ID
private String operationId; //id operation associato a un requestId
private String clientOperationId; //id client operation associato a un operationId
private ComponenteEnum componente; //componente che scrive l'evento
private Instant insertedTimestamp; //ora di inserimento evento
//// END LOGICAL REF

//// START FIELD FOR INTERFACE AND INTERN CHANGE
private CategoriaEventoEnum categoriaEvento;
private SottoTipoEventoEnum sottoTipoEvento;
//// END FIELD FOR INTERFACE AND INTERN CHANGE

//// START FIELD FOR INTERFACE
private CallTypeEnum callType;

private String fruitore;
private String fruitoreDescr;
private String erogatore;
private String erogatoreDescr;

private EsitoEnum esito;

private String httpMethod;
private String httpUri;
private String httpHeaders;
private String httpCallRemoteAddress;

private Integer httpStatusCode;
private Long executionTimeMs;

private String compressedPayload; //zip+Base64
private Integer compressedPayloadLength;

private String businessProcess;

private String operationStatus; //dettaglio response in uscita
private String operationErrorTitle; //dettaglio response in uscita
private String operationErrorDetail; //dettaglio response in uscita
private String operationErrorCode; //dettaglio response in uscita
//// END FIELD FOR INTERFACE

//// START FIELD FOR INTERN CHANGE
private String idDominio;
private String iuv;
private String ccp;
private String psp;
private String tipoVersamento;
private String tipoEvento;
private String stazione;
private String canale;
private String parametriSpecificiInterfaccia;
private String status;
private String info;

private String pspDescr;
private String noticeNumber;
private String creditorReferenceId;
private String paymentToken;
private String sessionIdOriginal;
private Boolean standIn;
//// END FIELD FOR INTERN CHANGE

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package it.gov.pagopa.wispconverter.repository.model.enumz;

public enum CallTypeEnum {
SERVER,
CLIENT;
}
Loading

0 comments on commit 4239cad

Please sign in to comment.