using Volpe.Cafe.Generic;
using Volpe.Cafe.MarketData.BaselineInfo;

using TechKey = Volpe.Cafe.TechKeys.TechKey128;

namespace Volpe.Cafe.MarketData.Design
{
    /// <summary>
    /// Defines a revision of manufacturer's compliance attributes for a specific model year.
    /// </summary>
    /// <seealso cref="IManufacturer"/>
    /// <seealso cref="IManufacturerInfo"/>
    public interface IManufacturerRevision : IManufacturerInfo
    {
        /// <summary>
        /// Gets the underlying <see cref="IManufacturer"/> associated with this manufacturer revision.
        /// </summary>
        IManufacturer Manufacturer { get; }

        /// <summary>
        /// Gets a description of baseline engineering characteristics for the <see cref="IManufacturer"/> associated
        /// with this manufacturer revision.
        /// </summary>
        BaselineManufacturer BaselineInfo { get; }

        /// <summary>
        /// Gets the model year associated with this manufacturer revision.
        /// </summary>
        int RevisionYear { get; }

        //----- values updated once at start of model year -----
        /// <summary>
        /// Gets or sets the pseudo-cost of fuel for a vehicle based on the manufacturer-specific number of payback
        /// years.
        /// </summary>
        PseudoFuelCost PseudoFuelCost { get; set; }

        //----- values updated throughout the model year -----
        /// <summary>
        /// Gets or sets the compliance statistics for the manufacturer.
        /// </summary>
        ComplianceStatistics ComplianceStats { get; set; }

        /// <summary>
        /// Gets or sets the overall sales volume for each technology that was applied during the compliance modeling.
        /// </summary>
        /// <remarks>
        /// <b>NOTE</b>:
        /// In the beginning of the model year, the applied sales volumes should be calculated based on the current
        /// "tech-applied" states of the manufacturer's fleet. The applied volumes should also be updated during the
        /// compliance modeling, whenever a new technology is applied to a vehicle.
        /// </remarks>
        double[] TechAppliedSales { get; set; }

        /// <summary>
        /// Gets or sets whether the phase-in threshold for a technology has been reached for a specific model year.
        /// </summary>
        /// <remarks>
        /// <b>NOTE</b>:
        /// In the beginning of a model year, the exhausted states should be set to true if the manufacturer's
        /// <see cref="TechAppliedSales"/> exceeds a predefined phase-in percentage for a technology. The exhausted
        /// sates should also be reevaluated during the compliance modeling, whenever a new technology is applied to a
        /// vehicle.
        /// </remarks>
        TechKey TechExhausted { get; set; }

        //----- values updated at end of model year -----
        /// <summary>
        /// Gets or sets the compliance costs associated with application of fuel improving technologies, as well as
        /// costs associated with credits and adjustments from off-cycle technologies, aggregated across all vehicle
        /// models produced by a manufacturer.
        /// </summary>
        RCValue<ComplianceCosts> ComplianceCosts { get; set; }

        /// <summary>
        /// Gets or sets the auxiliary costs associated with the hybrid/electric technology used on a vehicle,
        /// aggregated across all vehicle models produced by a manufacturer using those vehicle's unaltered state
        /// (before any new technology application).
        /// </summary>
        RCValue<AuxiliaryHEVCosts> InitAuxiliaryHevCosts { get; set; }

        /// <summary>
        /// Gets or sets the auxiliary costs associated with the hybrid/electric technology used on a vehicle,
        /// aggregated across all vehicle models produced by a manufacturer using those vehicle's "final" state for a
        /// specific model year.
        /// </summary>
        RCValue<AuxiliaryHEVCosts> AuxiliaryHevCosts { get; set; }

    }
}
