package com.capgemini.reports.definition.r13report.execution;

import com.capgemini.reports.JasperTemplate;
import com.capgemini.reports.builder.R13FppBuilder;
import com.capgemini.reports.builder.ReportBuilder;
import com.capgemini.reports.changeobjects.change.FPPRevision;
import com.capgemini.reports.definition.r13report.datapreparator.DataReportPreparatorR13FPP;
import com.capgemini.reports.execution.AbstractExecutionReport;
import com.capgemini.reports.execution.IDataReportPreparator;
import com.capgemini.reports.reports.parameters.EffectivityDate;
import lombok.Getter;

/**
 * This class controls the execution of a R13 report with FPP objects.
 */
@Getter
public class ExecutionR13FPP extends AbstractExecutionR13<ExecutionR13FPP, FPPRevision> {

    private static final long serialVersionUID = 3645528867618039977L;

    /**
     * Constructor.
     *
     * @param finalDate    {@link EffectivityDate} -the final date
     * @param previousDate {@link EffectivityDate} -the previous date
     */
    public ExecutionR13FPP(final EffectivityDate finalDate, final EffectivityDate previousDate) {
        super("FPP", finalDate, previousDate);
    }

    @Override
    public String getTemplateLocation() {
        return JasperTemplate.TEMPLATE_R13_FPP.getFilepath();
    }

    @Override
    public IDataReportPreparator<ExecutionR13FPP> getDataPreparator() {
        return new DataReportPreparatorR13FPP();
    }

    @Override
    public AbstractExecutionReport<?, ?> cloneTemplateToExecution() {
        return new ExecutionR13FPP(finalDate, startDate);
    }

    @Override
    public Class<? extends ReportBuilder> getReportBuilderClass() {
        return R13FppBuilder.class;
    }
}
