Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PAGOPA-2379 V3 API #274

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

feat: PAGOPA-2379 V3 API #274

wants to merge 18 commits into from

Conversation

cap-ang
Copy link
Contributor

@cap-ang cap-ang commented Dec 6, 2024

List of Changes

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@cap-ang cap-ang self-assigned this Dec 6, 2024
@cap-ang cap-ang added documentation Improvements or additions to documentation ignore-for-release Ignore pull request from the release labels Dec 12, 2024
@cap-ang cap-ang marked this pull request as ready for review December 12, 2024 16:27
@cap-ang cap-ang requested a review from a team as a code owner December 12, 2024 16:27
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

google-java-format

[google-java-format] reported by reviewdog 🐶

@NotBlank(message = "key is required")
private String key;
private String value;


[google-java-format] reported by reviewdog 🐶

import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

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 = "due date is required")
private LocalDateTime dueDate;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
private long fee;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
private long notificationFee;
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
private InstallmentStatus status;
@Valid
private List<TransferModel> transfer = new ArrayList<>();
@Valid
@Size(min=0, max=10)
@Schema(description = "it can added a maximum of 10 key-value pairs for metadata")
private List<InstallmentMetadataModel> installmentMetadata = new ArrayList<>();
public void addTransfers(TransferModel trans) {
transfer.add(trans);
}
public void removeTransfers(TransferModel trans) {
transfer.remove(trans);
}
public void addPaymentOptionMetadata(InstallmentMetadataModel metadataModel) {
installmentMetadata.add(metadataModel);
}
public void removePaymentOptionMetadata(InstallmentMetadataModel metadataModel) {
installmentMetadata.remove(metadataModel);
}


[google-java-format] reported by reviewdog 🐶

import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

@Size(max = 140) // todo use this field: is used that at the installment level
private String description;
private LocalDateTime validityDate;
private LocalDateTime retentionDate;
@Schema(description = "feature flag to enable the payment option to expire after the due date", example = "false", defaultValue = "false")
@NotNull(message = "switch to expired value is required")
private Boolean switchToExpired;


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

@Valid
private List<InstallmentModel> installments = new ArrayList<>();


[google-java-format] reported by reviewdog 🐶

public void addInstallment(InstallmentModel inst) {
installments.add(inst);
}


[google-java-format] reported by reviewdog 🐶

public void removeTransfers(InstallmentModel inst) {
installments.remove(inst);
}


[google-java-format] reported by reviewdog 🐶

import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.*;


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

@NotBlank(message = "iupd is required")
private String iupd;
@Schema(description = "feature flag to enable a debt position in stand-in mode", example = "true", defaultValue = "true")
private boolean payStandIn = true;
@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
@JsonProperty(access = Access.READ_ONLY)
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
private LocalDateTime paymentDate;
@JsonProperty(access = Access.READ_ONLY)
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
private DebtPositionStatusV3 status;
@Valid
private List<@Valid PaymentOptionModelV3> paymentOption = new ArrayList<>();
public void addPaymentOptions(PaymentOptionModelV3 paymentOpt) {
paymentOption.add(paymentOpt);
}
public void removePaymentOptions(PaymentOptionModelV3 paymentOpt) {
paymentOption.remove(paymentOpt);
}


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

@JsonProperty("payment_position_list")
@Schema(required = true)
@NotNull
@Valid
private List<PaymentPositionModelResponseV3> ppBaseResponseList;


[google-java-format] reported by reviewdog 🐶

@JsonProperty("page_info")
@Schema(required = true)
@NotNull
@Valid
private PageInfo pageInfo;


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

private String nav;
private String iuv;
private String organizationFiscalCode;
private long amount;
private String description;
private LocalDateTime dueDate;
private LocalDateTime paymentDate;
private LocalDateTime reportingDate;
private String paymentMethod;
private String pspCompany;
private long fee;
private long notificationFee;
private String idReceipt;
private String idFlowReporting;
private InstallmentStatus status;
private LocalDateTime lastUpdatedDate;


[google-java-format] reported by reviewdog 🐶

private List<InstallmentMetadataModelResponse> installmentMetadata = new ArrayList<>();


[google-java-format] reported by reviewdog 🐶

private List<TransferModelResponse> transfer = new ArrayList<>();


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

private LocalDateTime retentionDate;
private LocalDateTime insertedDate;
private Boolean switchToExpired;
private DebtorModel debtor;
private LocalDateTime validityDate;
private List<InstallmentModelResponse> installments = new ArrayList<>();


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

private String iupd;
private String organizationFiscalCode;
private String companyName; // es. Comune di Roma
private String officeName; // es. Ufficio Tributi
private LocalDateTime insertedDate;
private LocalDateTime publishDate;
private LocalDateTime paymentDate;
private DebtPositionStatusV3 status;
private LocalDateTime lastUpdatedDate;


[google-java-format] reported by reviewdog 🐶

private List<PaymentOptionModelResponseV3> paymentOption = new ArrayList<>();

@cap-ang cap-ang changed the title [PAGOPA-2379] feat: GPD options API [PAGOPA-2379] feat: V3 API definition Dec 20, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

google-java-format

[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶


[google-java-format] reported by reviewdog 🐶

private String iupd;
private String organizationFiscalCode;
private String companyName; // es. Comune di Roma
private String officeName; // es. Ufficio Tributi
private LocalDateTime insertedDate;
private LocalDateTime publishDate;
private LocalDateTime paymentDate;
private DebtPositionStatusV3 status;
private LocalDateTime lastUpdatedDate;


[google-java-format] reported by reviewdog 🐶

private List<PaymentOptionModelResponseV3> paymentOption = new ArrayList<>();

@pasqualespica pasqualespica changed the title [PAGOPA-2379] feat: V3 API definition feat : [PAGOPA-2379] V3 API definition Jan 14, 2025
@cap-ang cap-ang changed the title feat : [PAGOPA-2379] V3 API definition feat: PAGOPA-2379 V3 API definition Jan 14, 2025
* feat: Add v3 API input mapper

[PAGOPA-2480]
- Mapping from v3 model to entity has been created

* feat: Add v3 API output mapper

[PAGOPA-2480]
- Mapping from entity to v3 response model has been created

* feat: Update v3 Update, Publish

[PAGOPA-2480]
- Update v3 Update CRUD
- Update v3 Publish Action
- Create IPaymentPositionModel interface
- Fix v1 with UNDEFINED_DEBTOR default values

* refactoring: Add Converter and extract class

[PAGOPA-2480]
- Converter PaymentPosition Entity to Model V3 has been added
- In UtilityMapper class have been added common methods to map common PaymentPosition objects

* refactoring: Extract methods

[PAGOPA-2480]

* test: Add JUnit

[PAGOPA-2480]
- Add DebtPositionControllerV3Test

* test: Add JUnit

[PAGOPA-2480]
- Fix ErrorHandler
- Add Create JUnit

* test: Add JUnit DebtPositionControllerV3Test

[PAGOPA-2480]
- Add CRUD test cases for DebtPositionControllerV3Test

* test: Fix JUnit test

[PAGOPA-2480]

* refactoring: Reformat

[PAGOPA-2480]

* refactoring: Resolve sonar issue

[PAGOPA-2480]

* Fix

[PAGOPA-2480]

* test: Add JUnit

[PAGOPA-2480]
- Add JUnit test cases GET debt-position to improve coverage on ConverterV3PPEntityToModelResponse

* test: Refactoring JUnit

[PAGOPA-2480]
- Extract method

* feat: Update GetByNAV response and refactoring

[PAGOPA-2480]
- Update GetByNAV: Add new condition on debtor fields
- Extract UNDEFINED_DEBTOR variable in utility
- Check for status coherence before set to PaymentPositionModelV3 response instance

* Bump to version 0.11.74-1-PAGOPA-2480

* fix: Update Model-Entity converter

[PAGOPA-2480]
- The case (Opzione Unica + Opzione Rateale) has been included

* Bump to version 0.11.74-2-PAGOPA-2480

* Bump to version 0.11.74-3-PAGOPA-2480

* fix: Update Response Converter

[PAGOPA-2480]
- Improperly created outputs: did not map correctly to the entity (caused by replace with setPaymentOption)

* Bump to version 0.11.74-4-PAGOPA-2480

* config(HELM): Decrease probe initial delay

[PAGOPA-2480]

* Bump to version 0.11.74-5-PAGOPA-2480

* config(HELM): Increase probe initial delay

[PAGOPA-2480]

* test(JUnit): Add metadata in test cases

[PAGOPA-2480]

* chore: Adjust v3 validation

[PAGOPA-2480]

* Bump to version 0.11.74-6-PAGOPA-2480

* Bump to version 0.11.75-1-PAGOPA-2480

* chore: Adjust input validation

[PAGOPA-2480]

* chore: Update Swagger config

[PAGOPA-2480]

* Bump to version 0.11.75-2-PAGOPA-2480

* chore: Enhance Null Safety

[PAGOPA-2480]

* Bump to version 0.11.75-3-PAGOPA-2480

* refactoring: Resolve todo

[PAGOPA-2480]
- Update debtor type variable

* Bump to version 0.11.75-4-PAGOPA-2480

---------

Co-authored-by: pagopa-github-bot <[email protected]>
@cap-ang cap-ang changed the title feat: PAGOPA-2379 V3 API definition feat: PAGOPA-2379 V3 API Jan 15, 2025
@cap-ang cap-ang added the patch label Jan 15, 2025
Copy link
Contributor

This pull request does not contain a valid label. Please add one of the following labels: [major, minor, patch, patch, skip]

@cap-ang cap-ang added dev uat and removed ignore-for-release Ignore pull request from the release documentation Improvements or additions to documentation labels Jan 15, 2025
[PAGOPA-2379]
- Remove field injection java:S6813
@cap-ang cap-ang requested a review from pasqualespica January 15, 2025 15:46
Copy link
Contributor

This PR exceeds the recommended size of 400 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants