From c7efaa6f3be16ee3bc78b393f1da5c3a943fdee0 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Tue, 7 May 2024 21:40:31 +0200 Subject: [PATCH] feat(impl): [#528] add @Future to validUntil attribute --- .../tractusx/irs/policystore/models/CreatePolicyRequest.java | 2 ++ .../tractusx/irs/policystore/models/UpdatePolicyRequest.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/models/CreatePolicyRequest.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/models/CreatePolicyRequest.java index 59624d8d47..3942416ac5 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/models/CreatePolicyRequest.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/models/CreatePolicyRequest.java @@ -29,6 +29,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.json.JsonObject; +import jakarta.validation.constraints.Future; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; @@ -42,6 +43,7 @@ public record CreatePolicyRequest( @Schema(description = "Timestamp after which the policy will no longer be accepted in negotiations.", example = "2025-12-12T23:59:59.999Z") // @NotNull // + @Future(message = "must be in future") // OffsetDateTime validUntil, // @Schema(description = """ diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/models/UpdatePolicyRequest.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/models/UpdatePolicyRequest.java index cf10874e5d..1f20802afc 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/models/UpdatePolicyRequest.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/models/UpdatePolicyRequest.java @@ -27,6 +27,7 @@ import java.util.List; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.Future; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import org.eclipse.tractusx.irs.policystore.validators.ValidListOfBusinessPartnerNumbers; @@ -39,6 +40,7 @@ public record UpdatePolicyRequest( @Schema(description = "Timestamp after which the policy will no longer be accepted in negotiations.") // @NotNull // + @Future(message = "must be in future") // OffsetDateTime validUntil, // @Schema(description = "Business Partner Number (BPN).") //