package org.raddatz.familienarchiv.person;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.raddatz.familienarchiv.document.DatePrecision;
import org.raddatz.familienarchiv.person.PersonType;

import java.time.LocalDate;

@Data
public class PersonUpdateDTO {
    @NotNull
    private PersonType personType;
    @Size(max = 50)
    private String title;
    @Size(max = 100)
    private String firstName;
    @Size(max = 100)
    private String lastName;
    @Size(max = 200)
    private String alias;
    @Size(max = 5000)
    private String notes;
    private LocalDate birthDate;
    private DatePrecision birthDatePrecision;
    private LocalDate deathDate;
    private DatePrecision deathDatePrecision;
    // Mirror of the persons.generation CHECK constraint (V70). Bounds live in
    // PersonGeneration so DB, DTO, and importer all read from one place.
    @Min(PersonGeneration.MIN_GENERATION)
    @Max(PersonGeneration.MAX_GENERATION)
    private Integer generation;
}
