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.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.MappedCollection;

import jakarta.validation.constraints.Size;

@Getter
@Setter
public class GeoGroup {

	@Id
    @JsonIgnore
    private Integer id;

    @Size(max = 4)
    private String geoGroupCode;

    private String abbr;

    private LocalDate startDate;

    private LocalDate endDate;
    
    @MappedCollection(idColumn = "geo_group_id")
    private Set<GeoGroupMembership> geoGroupMembers;
    
    @MappedCollection(idColumn = "ref_id")
    @JsonSerialize(using = DescSetSerializer.class)
    private Set<GeoGroupDesc> geoGroupDescs;
    



}
