diff --git a/src/main/java/it/gov/pagopa/gpd/payments/pull/entity/PaymentPosition.java b/src/main/java/it/gov/pagopa/gpd/payments/pull/entity/PaymentPosition.java index 56659d7..dc70d09 100644 --- a/src/main/java/it/gov/pagopa/gpd/payments/pull/entity/PaymentPosition.java +++ b/src/main/java/it/gov/pagopa/gpd/payments/pull/entity/PaymentPosition.java @@ -94,10 +94,15 @@ public class PaymentPosition implements Serializable { private LocalDate lastUpdatedDate; @Column(name = "payment_date") private LocalDateTime paymentDate; + @Builder.Default @Column(name = "switch_to_expired", columnDefinition = "boolean DEFAULT false") private Boolean switchToExpired = false; + @Builder.Default + @Column(name = "pull", columnDefinition = "boolean DEFAULT true") + private Boolean pull = true; + @Builder.Default @NotNull @Version 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 f76f251..8b2ce2c 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 @@ -12,7 +12,8 @@ public class PaymentPositionRepository implements PanacheRepository { private static final String GET_VALID_POSITIONS_BY_TAXCODE_BASE = - "from PaymentPosition AS ppos Where ppos.fiscalCode = ?1 AND ppos.status IN ('VALID', 'PARTIALLY_PAID')"; + "from PaymentPosition AS ppos Where ppos.fiscalCode = ?1 " + + "AND ppos.status IN ('VALID', 'PARTIALLY_PAID') AND ppos.pull = true "; /** * Recovers a reactive stream of payment positions, using the debtor taxCode, and optionally the dueDate for which at least one