-
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.
* Initial commit * First Example Version * added tracing * Aggiunto profilo native * First try to decode * Decode working * Sha 256 calculation working in post. * First draft of model entities * Creato enum per function * Adding utils to validate BankKey * Scritte util * Fix * First implementation of BankKey Custom Validation * Change @NotNull in @nonnull * Custom Validator fixed * Added Status Enum, ModelEntity creation * Rename Status enum * ModelService refactor * decodebase64 refactor * Enum for function * Update application-local.properties Removed unused local property * adding helm and pipe * Refactoring * Rename root packager * Fix pom.xml * Refinement * reformat properties * removed useless files * Column annotation added * Renaming * Find working * add Notation * Fixing params, sha unique * BankConfig persistence * BankConfig persistence * Bpmn dto mapper * Fix general props * BOMN associations service created * BPMN associations service created * fixed Bpmn Resource endpoints logic * in BPMN creation, now Upload with S3 is done * removed unused import * fixed unit tests * fixed properties * fixed properties --------- Co-authored-by: Escarsel <[email protected]> Co-authored-by: USERSAD\evalenti <[email protected]> Co-authored-by: Simone Munao <[email protected]>
- Loading branch information
1 parent
c64db93
commit 3f6d716
Showing
57 changed files
with
1,574 additions
and
192 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
31 changes: 31 additions & 0 deletions
31
src/main/java/it/gov/pagopa/atmlayer/service/model/constraint/BankKeyConstraint.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.atmlayer.service.model.constraint; | ||
|
||
import it.gov.pagopa.atmlayer.service.model.validators.BankKeyValidator; | ||
import jakarta.validation.Constraint; | ||
import jakarta.validation.Payload; | ||
import jakarta.validation.constraintvalidation.SupportedValidationTarget; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static jakarta.validation.constraintvalidation.ValidationTarget.ANNOTATED_ELEMENT; | ||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE; | ||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
@Retention(RUNTIME) | ||
@Constraint(validatedBy = BankKeyValidator.class) | ||
@Target({ElementType.TYPE_USE, FIELD, METHOD, PARAMETER, ANNOTATION_TYPE}) | ||
@SupportedValidationTarget(ANNOTATED_ELEMENT) | ||
@Documented | ||
public @interface BankKeyConstraint { | ||
String message() default "{the BankKey is invalid}"; | ||
|
||
Class<?>[] groups() default {}; | ||
|
||
Class<? extends Payload>[] payload() default {}; | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/it/gov/pagopa/atmlayer/service/model/dto/BankKeyDto.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,17 @@ | ||
package it.gov.pagopa.atmlayer.service.model.dto; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
public class BankKeyDto { | ||
|
||
@NotNull(message = "The acquirerId cannot be null") | ||
private String acquirerId; | ||
|
||
private List<BranchDto> branches; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/it/gov/pagopa/atmlayer/service/model/dto/BpmnAssociationDto.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,15 @@ | ||
package it.gov.pagopa.atmlayer.service.model.dto; | ||
|
||
import it.gov.pagopa.atmlayer.service.model.constraint.BankKeyConstraint; | ||
import jakarta.validation.Valid; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
public class BpmnAssociationDto { | ||
|
||
private List<@BankKeyConstraint @Valid BankKeyDto> bankKeyDtoList; | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/it/gov/pagopa/atmlayer/service/model/dto/BpmnCreationDto.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.dto; | ||
|
||
import it.gov.pagopa.atmlayer.service.model.enumeration.functionTypeEnum; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
import jakarta.ws.rs.FormParam; | ||
import jakarta.ws.rs.core.MediaType; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.jboss.resteasy.reactive.PartType; | ||
|
||
import java.io.File; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
public class BpmnCreationDto { | ||
@FormParam("file") | ||
@PartType(MediaType.APPLICATION_XML) | ||
@NotNull(message = "bpmn file is required") | ||
private File file; | ||
|
||
@FormParam("filename") | ||
@NotNull(message = "filename is required") | ||
@Pattern(regexp = "^[a-zA-Z0-9_-]+$", message = "deve essere della forma ${regexp} e non contenere l'estensione del file") | ||
private String filename; | ||
|
||
@FormParam("functionType") | ||
@NotNull(message = "function type is required") | ||
private functionTypeEnum functionType; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/it/gov/pagopa/atmlayer/service/model/dto/BranchDto.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,15 @@ | ||
package it.gov.pagopa.atmlayer.service.model.dto; | ||
|
||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
public class BranchDto { | ||
|
||
private String branchId; | ||
|
||
private List<String> terminalId; | ||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/it/gov/pagopa/atmlayer/service/model/entity/BpmnBankConfig.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,58 @@ | ||
package it.gov.pagopa.atmlayer.service.model.entity; | ||
|
||
import com.fasterxml.jackson.annotation.JsonManagedReference; | ||
import io.quarkus.hibernate.reactive.panache.PanacheEntityBase; | ||
import it.gov.pagopa.atmlayer.service.model.enumeration.functionTypeEnum; | ||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.EmbeddedId; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.JoinColumns; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
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; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Table(name = "bpmn_bank_config") | ||
public class BpmnBankConfig extends PanacheEntityBase implements Serializable { | ||
|
||
@EmbeddedId | ||
private BpmnBankConfigPK bpmnBankConfigPK; | ||
|
||
@Column(name = "function_type") | ||
@Enumerated(EnumType.STRING) | ||
private functionTypeEnum functionType; | ||
|
||
@Column(name = "enabled", columnDefinition = "boolean default true") | ||
private Boolean enabled; | ||
|
||
@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; | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/it/gov/pagopa/atmlayer/service/model/entity/BpmnBankConfigPK.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,36 @@ | ||
package it.gov.pagopa.atmlayer.service.model.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
import java.util.UUID; | ||
|
||
@Embeddable | ||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class BpmnBankConfigPK implements Serializable { | ||
|
||
@NotNull(message = "bpmn id cannot be null") | ||
@Column(name = "bpmn_id") | ||
private UUID bpmnId; | ||
|
||
@NotNull(message = "bpmn model version cannot be null") | ||
@Column(name = "bpmn_model_version") | ||
private Long bpmnModelVersion; | ||
|
||
@NotNull(message = "acquirer id cannot be null") | ||
@Column(name = "acquirer_id") | ||
private String acquirerId; | ||
@Column(name = "branch_id") | ||
private String branchId; | ||
@Column(name = "terminal_id") | ||
private String terminalId; | ||
} |
89 changes: 89 additions & 0 deletions
89
src/main/java/it/gov/pagopa/atmlayer/service/model/entity/BpmnVersion.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,89 @@ | ||
package it.gov.pagopa.atmlayer.service.model.entity; | ||
|
||
import io.quarkus.hibernate.reactive.panache.PanacheEntityBase; | ||
import it.gov.pagopa.atmlayer.service.model.enumeration.StatusEnum; | ||
import it.gov.pagopa.atmlayer.service.model.enumeration.functionTypeEnum; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.IdClass; | ||
import jakarta.persistence.Table; | ||
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 | ||
@Setter | ||
@Getter | ||
@NoArgsConstructor | ||
@Table(name = "bpmn_version") | ||
@IdClass(BpmnVersionPK.class) | ||
public class BpmnVersion extends PanacheEntityBase implements Serializable { | ||
|
||
@GeneratedValue(strategy = GenerationType.UUID) | ||
@Column(name = "bpmn_id", nullable = false, updatable = false) | ||
@Id | ||
private UUID bpmnId; | ||
|
||
@Column(name = "model_version", nullable = false) | ||
@Id | ||
private Long modelVersion = 1L; | ||
|
||
@Column(name = "deployed_file_name") | ||
private String deployedFileName; | ||
|
||
@Column(name = "definition_key") | ||
private String definitionKey; | ||
|
||
@Column(name = "function_type") | ||
@Enumerated(EnumType.STRING) | ||
private functionTypeEnum functionType; | ||
|
||
@Column(name = "status") | ||
private StatusEnum status; | ||
|
||
@Column(name = "sha256", unique = true) | ||
private String sha256; | ||
|
||
@Column(name = "enabled", columnDefinition = "boolean default true") | ||
private Boolean enabled; | ||
|
||
@Column(name = "definition_version_camunda") | ||
private Integer definitionVersionCamunda; | ||
|
||
@Column(name = "camunda_definition_id") | ||
private String camundaDefinitionId; | ||
|
||
@Column(name = "description") | ||
private String description; | ||
|
||
@Column(name = "resource") | ||
private String resource; | ||
|
||
@Column(name = "deployement_id") | ||
private UUID deploymentId; | ||
|
||
@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; | ||
} |
Oops, something went wrong.