Skip to content

Commit

Permalink
[PAGOPA-1702] feat: update models
Browse files Browse the repository at this point in the history
  • Loading branch information
cap-ang committed Apr 23, 2024
1 parent 067ebc6 commit 6ff2b05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ public class PaymentOptionModel implements Serializable {
*/
private static final long serialVersionUID = -8328320637402363721L;

@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String nav;
@NotBlank(message = "iuv is required")
private String iuv;
@NotNull(message = "amount is required")
private Long amount;
@NotBlank(message = "payment option description is required")
@Size(max = 140) // compliant to paForNode.xsd
private String description;
@NotNull(message = "is partial payment is required")
private Boolean isPartialPayment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import it.gov.pagopa.gpd.upload.model.pd.enumeration.DebtPositionStatus;
import it.gov.pagopa.gpd.upload.model.pd.enumeration.Type;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down Expand Up @@ -40,6 +37,8 @@ public class PaymentPositionModel implements Serializable {
private String iupd;
@NotNull(message = "type is required")
private Type type;
@Schema(description = "feature flag to enable a debt position in stand-in mode", example = "true", defaultValue = "true")
private boolean payStandIn;
@NotBlank(message = "fiscal code is required")
private String fiscalCode;
@NotBlank(message = "full name is required")
Expand All @@ -56,11 +55,14 @@ public class PaymentPositionModel implements Serializable {
private String email;
private String phone;
@Schema(description = "feature flag to enable the debt position to expire after the due date", example = "false", defaultValue = "false")
@NotNull(message = "switch to expired value is required")
private Boolean switchToExpired;

// Payment Position properties
@NotBlank(message = "company name is required")
@Size(max = 140) // compliant to paForNode.xsd
private String companyName; // es. Comune di Roma
@Size(max = 140) // compliant to paForNode.xsd
private String officeName; // es. Ufficio Tributi
private LocalDateTime validityDate;
@JsonProperty(access = Access.READ_ONLY)
Expand All @@ -69,7 +71,7 @@ public class PaymentPositionModel implements Serializable {
private DebtPositionStatus status;

@Valid
private List<PaymentOptionModel> paymentOption = new ArrayList<>();
private List<@Valid PaymentOptionModel> paymentOption = new ArrayList<>();

public void addPaymentOptions(PaymentOptionModel paymentOpt) {
paymentOption.add(paymentOpt);
Expand Down

0 comments on commit 6ff2b05

Please sign in to comment.