using System;
using Volpe.Cafe.ModelSettings;
using Volpe.Cafe.Reporting.Generators;

namespace Volpe.Cafe.Reporting.ModelingReports
{
    /// <summary>
    /// Provides support for generating a <b>consumer costs</b> modeling report.
    /// </summary>
    [Serializable]
    public class ConsumerCostsReport : ModelingReport
    {
        /// <inheritdoc cref="ModelingReport(string, bool, Func{string[]})"/>
        public ConsumerCostsReport(string path, bool append = false)
            : base(path, append, GetHeaders) { }

        /// <inheritdoc/>
        public override ReportDataGenerator GetDataGenerator(
            Scenario scen, ReportingData data, ModelingSettings settings)
        {
            return new ConsumerCostsReportDataGenerator(scen, data, settings);
        }

        private static new string[] GetHeaders()
        {
            string[] headers = {
                //----- header columns -----
                "Scenario", "Scenario Name", "Model Year", "Reg-Class", "Disc-Rate",

                //----- paybacks & sales -----
                "Payback", "Payback TCO",
                "Sales",

                //----- cost "averages" -----
                "Avg Foregone Consumer Sales Surplus", 
                "Avg Tech Cost", "Avg Reg Cost", "Avg Tax Credit", "Avg Battery Tax Credit",
                "Avg Maint/Repair Cost", "Avg Implicit Opportunity Cost",
                "Avg Taxes/Fees", "Avg Financing Cost", "Avg Insurance Cost",
                "Avg Retail Fuel Outlay", "Avg Rebound Fuel Cost", "Avg Drive Value",
                "Avg Reallocated Value", "Avg Refueling Time Cost",

                //----- costs and benefits subtotals -----
                "Avg Consumer Costs", "Avg Consumer Benefits", "Avg Net Consumer Benefits"
            };

            return headers;
        }

    }

    /// <summary>
    /// Provides support for generating an <b>"incremental" consumer costs</b> modeling report.
    /// </summary>
    [Serializable]
    public class ConsumerCostsIncrementalReport : ConsumerCostsReport
    {
        /// <inheritdoc/>
        public ConsumerCostsIncrementalReport(string path, bool append = false)
            : base(path, append) { }

        /// <inheritdoc/>
        public override ReportDataGenerator GetDataGenerator(
            Scenario scen, ReportingData data, ModelingSettings settings)
        {
            return base.GetDataGenerator(scen, data, settings).AsIncremental();
        }

    }
}
