package de.avatic.taric.model;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import de.avatic.taric.serializer.DescSetSerializer;
import jakarta.validation.constraints.Size;
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 java.util.Set;

@Getter
@Setter
public class Geo {

	@Id
    @JsonIgnore
    private Integer id;

    @Size(max = 2)
    @Column("iso_3166_code")
    private String iso3166Code;
    
    @MappedCollection(idColumn = "ref_id")
    @JsonSerialize(using = DescSetSerializer.class)
    private Set<GeoDesc> geoDesc;


}
