diff --git a/src/main/java/it/gov/pagopa/gpd/payments/pull/models/PaymentNotice.java b/src/main/java/it/gov/pagopa/gpd/payments/pull/models/PaymentNotice.java index 3b237da..6ff0671 100644 --- a/src/main/java/it/gov/pagopa/gpd/payments/pull/models/PaymentNotice.java +++ b/src/main/java/it/gov/pagopa/gpd/payments/pull/models/PaymentNotice.java @@ -24,7 +24,7 @@ public class PaymentNotice implements Serializable { */ private static final long serialVersionUID = -5951473285697199137L; - @Schema(description = "Unique ID of the Debt Position (for positions originating from ACA)", + @Schema(description = "Unique ID of the Debt Position (for positions originating from ACA the IUPD starts with ACA_)", required = true) private String iupd; @Schema(description = "Tax code of the person to whom the Debt Position is registered", required = true) diff --git a/src/main/java/it/gov/pagopa/gpd/payments/pull/repository/PaymentPositionRepository.java b/src/main/java/it/gov/pagopa/gpd/payments/pull/repository/PaymentPositionRepository.java index 89aa956..5c17879 100644 --- a/src/main/java/it/gov/pagopa/gpd/payments/pull/repository/PaymentPositionRepository.java +++ b/src/main/java/it/gov/pagopa/gpd/payments/pull/repository/PaymentPositionRepository.java @@ -24,16 +24,10 @@ public class PaymentPositionRepository implements PanacheRepository= ?2)"; - public String buildQueryBase() { + public String buildQuery(String query) { return keepAca - ? BASE_QUERY + " AND ppos.serviceType IN ('ACA', 'GPD')" - : BASE_QUERY + " AND ppos.serviceType = 'GPD'"; - } - - public String buildQueryWithDueDate() { - return keepAca - ? DUE_DATE_QUERY + " AND ppos.serviceType IN ('ACA', 'GPD')" - : DUE_DATE_QUERY + " AND ppos.serviceType = 'GPD'"; + ? query + " AND ppos.serviceType IN ('ACA', 'GPD')" + : query + " AND ppos.serviceType = 'GPD'"; } /** @@ -49,7 +43,7 @@ public String buildQueryWithDueDate() { public List findPaymentPositionsByTaxCodeAndDueDate( String taxCode, LocalDate dueDate, Integer limit, Integer page) { - String query = (dueDate == null) ? buildQueryBase() : buildQueryWithDueDate(); + String query = (dueDate == null) ? buildQuery(BASE_QUERY) : buildQuery(DUE_DATE_QUERY); return dueDate == null ? find(query, taxCode)