package de.avatic.taric.model;

import java.time.LocalDate;
import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import de.avatic.taric.serializer.DescSetSerializer;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.MappedCollection;
import org.springframework.data.relational.core.mapping.Table;

import jakarta.validation.constraints.Size;


@Getter
@Setter
@Table("footnote")
public class Footnote {

	@Id
    @JsonIgnore
    private Integer id;

    @Size(max = 8)
    @Column("footnote")
    private String footnote;

    @Column("start_date")
    private LocalDate startDate;


    @Column("end_date")
    private LocalDate endDate;

    @MappedCollection(idColumn = "ref_id")
    @JsonSerialize(using = DescSetSerializer.class)
    @JsonProperty("desc")
    private Set<FootnotesDesc> footnotesDesc;

}
