package de.avatic.taric.model;

import java.time.LocalDate;


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import de.avatic.taric.serializer.GeoReferenceSerializer;
import org.springframework.data.annotation.Id;
import org.springframework.data.jdbc.core.mapping.AggregateReference;
import org.springframework.data.relational.core.mapping.Column;



public class GeoGroupMembership {

	@Id
    @JsonIgnore
    private Integer id;

    private LocalDate startDate;

    private LocalDate endDate;

    @Column("geo_id")
    @JsonSerialize(using = GeoReferenceSerializer.class)
    private AggregateReference<Geo, Integer> geo;

    public GeoGroupMembership(LocalDate startDate, LocalDate endDate,
			AggregateReference<Geo, Integer> geo) {
		this.startDate = startDate;
		this.endDate = endDate;
		this.geo = geo;
	}

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDate getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDate startDate) {
        this.startDate = startDate;
    }

    public LocalDate getEndDate() {
        return endDate;
    }

    public void setEndDate(LocalDate endDate) {
        this.endDate = endDate;
    }

    public AggregateReference<Geo, Integer> getGeo() {
        return geo;
    }

    public void setGeo(AggregateReference<Geo, Integer> geo) {
        this.geo = geo;
    }
}
