generated from pagopa/template-java-spring-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
180 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/it/gov/pagopa/wispconverter/repository/ReEventRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> { | ||
|
||
} |
87 changes: 87 additions & 0 deletions
87
src/main/java/it/gov/pagopa/wispconverter/repository/model/ReEventEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/it/gov/pagopa/wispconverter/repository/model/enumz/CallTypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/it/gov/pagopa/wispconverter/repository/model/enumz/CategoriaEventoEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package it.gov.pagopa.wispconverter.repository.model.enumz; | ||
|
||
public enum CategoriaEventoEnum { | ||
INTERFACCIA, | ||
INTERNO; | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/it/gov/pagopa/wispconverter/repository/model/enumz/ComponenteEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package it.gov.pagopa.wispconverter.repository.model.enumz; | ||
|
||
public enum ComponenteEnum { | ||
// FESP, | ||
WISP_SOAP_CONVERTER, | ||
WISP_CONVERTER; | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/it/gov/pagopa/wispconverter/repository/model/enumz/EsitoEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package it.gov.pagopa.wispconverter.repository.model.enumz; | ||
|
||
public enum EsitoEnum { | ||
INVIATA, INVIATA_KO, RICEVUTA, RICEVUTA_KO, NO_RICEVUTA, CAMBIO_STATO; | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/it/gov/pagopa/wispconverter/repository/model/enumz/SottoTipoEventoEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package it.gov.pagopa.wispconverter.repository.model.enumz; | ||
|
||
public enum SottoTipoEventoEnum { | ||
REQ, | ||
RESP, | ||
INTERN; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/it/gov/pagopa/wispconverter/service/mapper/ReEventMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package it.gov.pagopa.wispconverter.service.mapper; | ||
|
||
import it.gov.pagopa.wispconverter.repository.model.ReEventEntity; | ||
import it.gov.pagopa.wispconverter.service.model.CommonRPTFieldsDTO; | ||
import it.gov.pagopa.wispconverter.service.model.PaymentNoticeContentDTO; | ||
import it.gov.pagopa.wispconverter.service.model.re.ReEventDto; | ||
import org.mapstruct.*; | ||
|
||
import java.time.Instant; | ||
import java.time.LocalDateTime; | ||
import java.time.ZoneId; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.TimeZone; | ||
|
||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) | ||
public interface ReEventMapper { | ||
|
||
static final String PATTERN_FORMAT = "yyyy-MM-dd"; | ||
|
||
@Mapping(source = "insertedTimestamp", target = "partitionKey", qualifiedByName = "partitionKeyFromInstant") | ||
ReEventEntity toReEventEntity(ReEventDto reEventDto); | ||
|
||
@Named("partitionKeyFromInstant") | ||
public static String partitionKeyFromInstant(Instant insertedTimestamp) { | ||
return insertedTimestamp == null ? null : DateTimeFormatter | ||
.ofPattern(PATTERN_FORMAT) | ||
.withZone(ZoneId.systemDefault()) | ||
.format(insertedTimestamp); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters