package gov.samhsa.c2s.c2suiapi.infrastructure.dto;

import gov.samhsa.c2s.common.validator.constraint.PresentOrFuture;
import lombok.Data;
import org.hibernate.validator.constraints.ScriptAssert;

import javax.validation.Valid;
import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;

@Data
@ScriptAssert(
        lang = "javascript",
        alias = "_",
        script = "_.startDate != null && _.endDate != null && _.startDate.isBefore(_.endDate)",
        message = "consent end date must be after consent start date")
public class ConsentDto {
    private Long id;
    @NotNull
    @Future
    private LocalDate endDate;
    @Valid
    @NotNull
    private IdentifiersDto fromProviders;
    @Valid
    @NotNull
    private IdentifiersDto sharePurposes;
    @Valid
    @NotNull
    private IdentifiersDto shareSensitivityCategories;
    @NotNull
    @PresentOrFuture
    private LocalDate startDate;
    @Valid
    @NotNull
    private IdentifiersDto toProviders;
}
@@ -802,14 +802,9 @@
 Dto 
-shareP
+p
 urpo
@@ -864,13 +864,8 @@
 to s
-hareS
 ensi
@@ -1012,10 +1012,79 @@
 oviders;
+%0A%0A    @NotNull%0A    private boolean shareSensitivityCategoriesEnabled;
 %0A%7D

Update Consent Dto to have shareSensitivityCategoriesEnabled attribute