generated from pagopa-archive/template-java-microservice
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from pagopa/PAGOPA-1492-sviluppo-implementazi…
…one-struttura-nuove-api PAGOPA-1492 multi cart implementation
- Loading branch information
Showing
33 changed files
with
1,504 additions
and
23 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
19 changes: 19 additions & 0 deletions
19
src/main/java/it/gov/pagopa/afm/calculator/model/PaymentNoticeItem.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,19 @@ | ||
package it.gov.pagopa.afm.calculator.model; | ||
|
||
import lombok.*; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotEmpty; | ||
import javax.validation.constraints.NotNull; | ||
import java.util.List; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Data | ||
@Builder | ||
@ToString | ||
public class PaymentNoticeItem { | ||
@NotNull private Long paymentAmount; | ||
@NotNull private String primaryCreditorInstitution; | ||
@Valid @NotNull @NotEmpty private List<TransferListItem> transferList; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/it/gov/pagopa/afm/calculator/model/PaymentOptionByPspMulti.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,22 @@ | ||
package it.gov.pagopa.afm.calculator.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotEmpty; | ||
import javax.validation.constraints.NotNull; | ||
import java.util.ArrayList; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Data | ||
public class PaymentOptionByPspMulti { | ||
private String idChannel; | ||
private String idBrokerPsp; | ||
private String paymentMethod; | ||
private String touchpoint; | ||
private String bin; | ||
@Valid @NotNull @NotEmpty private ArrayList<PaymentNoticeItem> paymentNotice; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/it/gov/pagopa/afm/calculator/model/PaymentOptionMulti.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,24 @@ | ||
package it.gov.pagopa.afm.calculator.model; | ||
|
||
import lombok.*; | ||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotEmpty; | ||
import javax.validation.constraints.NotNull; | ||
import java.util.List; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Data | ||
@Builder | ||
@ToString | ||
public class PaymentOptionMulti { | ||
private String bin; | ||
private String paymentMethod; | ||
private String touchpoint; | ||
private List<PspSearchCriteria> idPspList; | ||
@Valid @NotNull @NotEmpty private List<PaymentNoticeItem> paymentNotice; | ||
|
||
public Long getPaymentAmount () { | ||
return this.getPaymentNotice().stream().mapToLong(PaymentNoticeItem::getPaymentAmount).sum(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/it/gov/pagopa/afm/calculator/model/calculatormulti/BundleOption.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,26 @@ | ||
package it.gov.pagopa.afm.calculator.model.calculatormulti; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.io.Serializable; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Builder | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class BundleOption implements Serializable { | ||
/** generated serialVersionUID */ | ||
private static final long serialVersionUID = -7404184031676587394L; | ||
|
||
@Schema( | ||
description = | ||
"if true (the payment amount is lower than the threshold value) the bundles onus is not" | ||
+ " calculated (always false)") | ||
private Boolean belowThreshold; | ||
|
||
private List<Transfer> bundleOptions; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/it/gov/pagopa/afm/calculator/model/calculatormulti/Fee.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,18 @@ | ||
package it.gov.pagopa.afm.calculator.model.calculatormulti; | ||
|
||
import lombok.*; | ||
import java.io.Serializable; | ||
|
||
@Builder | ||
@Data | ||
@ToString | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class Fee implements Serializable { | ||
/** generated serialVersionUID */ | ||
private static final long serialVersionUID = 1287710978645388173L; | ||
|
||
private String creditorInstitution; | ||
private long primaryCiIncurredFee; | ||
private long actualCiIncurredFee; | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/it/gov/pagopa/afm/calculator/model/calculatormulti/Transfer.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,41 @@ | ||
package it.gov.pagopa.afm.calculator.model.calculatormulti; | ||
|
||
import lombok.*; | ||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotEmpty; | ||
import javax.validation.constraints.NotNull; | ||
import java.io.Serializable; | ||
import java.util.Comparator; | ||
import java.util.List; | ||
|
||
@Builder | ||
@Data | ||
@ToString | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class Transfer implements Comparable<Transfer>, Serializable { | ||
/** generated serialVersionUID */ | ||
private static final long serialVersionUID = 1287710978645388173L; | ||
|
||
private Long taxPayerFee; | ||
private Long actualPayerFee; | ||
private String paymentMethod; | ||
private String touchpoint; | ||
private String idBundle; | ||
private String bundleName; | ||
private String bundleDescription; | ||
private List<String> idsCiBundle; | ||
private String idPsp; | ||
private String idChannel; | ||
private String idBrokerPsp; | ||
private Boolean onUs; | ||
private String abi; | ||
private String pspBusinessName; | ||
@Valid @NotNull @NotEmpty private List<Fee> fees; | ||
|
||
@Override | ||
public int compareTo(Transfer t) { | ||
// order by onUs | ||
return Comparator.comparing((Transfer tr) -> tr.onUs).reversed().compare(this, t); | ||
} | ||
} |
Oops, something went wrong.