-
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.
resolved problem on Transaction when calling s3Services
added mappers, added dto
- Loading branch information
Showing
32 changed files
with
448 additions
and
322 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
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
19 changes: 0 additions & 19 deletions
19
src/main/java/it/gov/pagopa/atmlayer/service/model/entity/Person.java
This file was deleted.
Oops, something went wrong.
86 changes: 86 additions & 0 deletions
86
src/main/java/it/gov/pagopa/atmlayer/service/model/entity/ResourceFile.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,86 @@ | ||
package it.gov.pagopa.atmlayer.service.model.entity; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import io.quarkus.hibernate.reactive.panache.PanacheEntityBase; | ||
import it.gov.pagopa.atmlayer.service.model.enumeration.ResourceTypeEnum; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.JoinColumns; | ||
import jakarta.persistence.OneToOne; | ||
import jakarta.persistence.PrePersist; | ||
import jakarta.persistence.Table; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.hibernate.annotations.CreationTimestamp; | ||
import org.hibernate.annotations.UpdateTimestamp; | ||
|
||
import java.io.Serializable; | ||
import java.sql.Timestamp; | ||
import java.util.UUID; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@Table(name = "resource_file_model") | ||
public class ResourceFile extends PanacheEntityBase implements Serializable { | ||
|
||
@GeneratedValue(strategy = GenerationType.UUID) | ||
@Column(name = "id", nullable = false, updatable = false) | ||
@Id | ||
private UUID id; | ||
|
||
@Column(name = "resource_type") | ||
@Enumerated(EnumType.STRING) | ||
@NotNull | ||
private ResourceTypeEnum resourceType; | ||
|
||
@OneToOne(fetch = FetchType.LAZY) | ||
@JoinColumns({ | ||
@JoinColumn(name = "bpmn_id", referencedColumnName = "bpmn_id"), | ||
@JoinColumn(name = "bpmn_model_version", referencedColumnName = "model_version") | ||
}) | ||
@JsonIgnore | ||
private BpmnVersion bpmn; | ||
|
||
@NotNull | ||
@Column(name = "storage_key") | ||
private String storageKey; | ||
|
||
@Column(name = "file_name") | ||
private String fileName; | ||
|
||
private String extension; | ||
|
||
@CreationTimestamp | ||
@Column(name = "created_at") | ||
private Timestamp createdAt; | ||
|
||
@UpdateTimestamp | ||
@Column(name = "last_updated_at") | ||
private Timestamp lastUpdatedAt; | ||
|
||
@Column(name = "created_by") | ||
private String createdBy; | ||
|
||
@Column(name = "last_updated_by") | ||
private String lastUpdatedBy; | ||
|
||
@PrePersist | ||
void onPrePersist() { | ||
this.extension = resourceType.getExtension(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/it/gov/pagopa/atmlayer/service/model/mapper/BpmnConfigMapper.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,33 @@ | ||
package it.gov.pagopa.atmlayer.service.model.mapper; | ||
|
||
import it.gov.pagopa.atmlayer.service.model.entity.BpmnBankConfig; | ||
import it.gov.pagopa.atmlayer.service.model.model.BpmnBankConfigDTO; | ||
import org.mapstruct.IterableMapping; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.Named; | ||
import org.mapstruct.NullValuePropertyMappingStrategy; | ||
|
||
import java.util.Collection; | ||
|
||
@Mapper(componentModel = "cdi", nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE) | ||
public interface BpmnConfigMapper { | ||
|
||
@Mapping(source = "bpmnBankConfigPK.bpmnId", target = "bpmnId") | ||
@Mapping(source = "bpmnBankConfigPK.bpmnModelVersion", target = "bpmnModelVersion") | ||
@Mapping(source = "bpmnBankConfigPK.acquirerId", target = "acquirerId") | ||
@Mapping(source = "bpmnBankConfigPK.branchId", target = "branchId") | ||
@Mapping(source = "bpmnBankConfigPK.terminalId", target = "terminalId") | ||
@Named("toBpmnBankConfigDTO") | ||
BpmnBankConfigDTO toDTO(BpmnBankConfig bpmnBankConfig); | ||
|
||
@Mapping(source = "bpmnId", target = "bpmnBankConfigPK.bpmnId") | ||
@Mapping(source = "bpmnModelVersion", target = "bpmnBankConfigPK.bpmnModelVersion") | ||
@Mapping(source = "acquirerId", target = "bpmnBankConfigPK.acquirerId") | ||
@Mapping(source = "branchId", target = "bpmnBankConfigPK.branchId") | ||
@Mapping(source = "terminalId", target = "bpmnBankConfigPK.terminalId") | ||
BpmnBankConfig toEntity(BpmnBankConfigDTO bankConfigDTO); | ||
|
||
@IterableMapping(qualifiedByName = "toBpmnBankConfigDTO") | ||
Collection<BpmnBankConfigDTO> toDTOList(Collection<BpmnBankConfig> bpmnBankConfig); | ||
} |
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
15 changes: 0 additions & 15 deletions
15
src/main/java/it/gov/pagopa/atmlayer/service/model/mapper/PersonMapper.java
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
src/main/java/it/gov/pagopa/atmlayer/service/model/mapper/ResourceFileMapper.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,14 @@ | ||
package it.gov.pagopa.atmlayer.service.model.mapper; | ||
|
||
import it.gov.pagopa.atmlayer.service.model.entity.ResourceFile; | ||
import it.gov.pagopa.atmlayer.service.model.model.ResourceFileDTO; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
|
||
@Mapper(componentModel = "cdi") | ||
public interface ResourceFileMapper { | ||
|
||
ResourceFileDTO toDTO(ResourceFile bpmnVersion); | ||
@Mapping(ignore = true, target = "bpmn") | ||
ResourceFile toEntity(ResourceFileDTO bpmnDTO); | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/it/gov/pagopa/atmlayer/service/model/model/BpmnBankConfigDTO.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,33 @@ | ||
package it.gov.pagopa.atmlayer.service.model.model; | ||
|
||
import it.gov.pagopa.atmlayer.service.model.enumeration.FunctionTypeEnum; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
import java.sql.Timestamp; | ||
import java.util.UUID; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@ToString | ||
@EqualsAndHashCode | ||
public class BpmnBankConfigDTO { | ||
private UUID bpmnId; | ||
private Long bpmnModelVersion; | ||
private String acquirerId; | ||
private String branchId; | ||
private String terminalId; | ||
private FunctionTypeEnum functionType; | ||
private Timestamp createdAt; | ||
private Timestamp lastUpdatedAt; | ||
private String createdBy; | ||
private String lastUpdatedBy; | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/it/gov/pagopa/atmlayer/service/model/model/BpmnDTO.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,43 @@ | ||
package it.gov.pagopa.atmlayer.service.model.model; | ||
|
||
import it.gov.pagopa.atmlayer.service.model.enumeration.FunctionTypeEnum; | ||
import it.gov.pagopa.atmlayer.service.model.enumeration.StatusEnum; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
import java.sql.Timestamp; | ||
import java.util.UUID; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@ToString | ||
@EqualsAndHashCode | ||
public class BpmnDTO { | ||
|
||
private UUID bpmnId; | ||
private Long modelVersion; | ||
private String deployedFileName; | ||
private String definitionKey; | ||
private FunctionTypeEnum functionType; | ||
private StatusEnum status; | ||
private String sha256; | ||
private Integer definitionVersionCamunda; | ||
private String camundaDefinitionId; | ||
private String description; | ||
private ResourceFileDTO resourceFile; | ||
private String resource; | ||
private UUID deploymentId; | ||
private Timestamp createdAt; | ||
private Timestamp lastUpdatedAt; | ||
private String createdBy; | ||
private String lastUpdatedBy; | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/it/gov/pagopa/atmlayer/service/model/model/ObjectStorePutResponse.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,20 @@ | ||
package it.gov.pagopa.atmlayer.service.model.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
@ToString | ||
@EqualsAndHashCode | ||
public class ObjectStorePutResponse { | ||
String storage_key; | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/it/gov/pagopa/atmlayer/service/model/model/ResourceFileDTO.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,30 @@ | ||
package it.gov.pagopa.atmlayer.service.model.model; | ||
|
||
import it.gov.pagopa.atmlayer.service.model.enumeration.ResourceTypeEnum; | ||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
import java.sql.Timestamp; | ||
import java.util.UUID; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ToString | ||
@EqualsAndHashCode | ||
public class ResourceFileDTO { | ||
private UUID id; | ||
private ResourceTypeEnum resourceType; | ||
private String storageKey; | ||
private String fileName; | ||
private String extension; | ||
private Timestamp createdAt; | ||
private Timestamp lastUpdatedAt; | ||
private String createdBy; | ||
private String lastUpdatedBy; | ||
} |
17 changes: 0 additions & 17 deletions
17
src/main/java/it/gov/pagopa/atmlayer/service/model/repository/PersonRepository.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.