package cz.utb.tadis.charts.http;

import com.fasterxml.jackson.annotation.JsonFormat;
import cz.utb.tadis.charts.model.ChartAxis;
import cz.utb.tadis.charts.model.ChartType;

import java.time.LocalDate;

public class ChartsFormData {

    private ChartAxis[] chartAxes;
    private ChartType[] chartTypes;

    private LocalDate fromDate;
    private LocalDate toDate;

    public ChartsFormData() {
    }

    public ChartsFormData(ChartAxis[] chartAxes, ChartType[] chartTypes, LocalDate fromDate, LocalDate toDate) {
        this.chartAxes = chartAxes;
        this.chartTypes = chartTypes;
        this.fromDate = fromDate;
        this.toDate = toDate;
    }

    public ChartAxis[] getChartAxes() {
        return chartAxes;
    }

    public void setChartAxes(ChartAxis[] chartAxes) {
        this.chartAxes = chartAxes;
    }

    public ChartType[] getChartTypes() {
        return chartTypes;
    }

    public void setChartTypes(ChartType[] chartTypes) {
        this.chartTypes = chartTypes;
    }

    @JsonFormat(pattern="d.M.YYYY")
    public LocalDate getFromDate() {
        return fromDate;
    }

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
    public void setFromDate(LocalDate fromDate) {
        this.fromDate = fromDate;
    }

    @JsonFormat(pattern="d.M.YYYY")
    public LocalDate getToDate() {
        return toDate;
    }

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
    public void setToDate(LocalDate toDate) {
        this.toDate = toDate;
    }
}
