#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

using System;
using Volpe.Cafe.MarketData.BaselineInfo;
using Volpe.Cafe.MarketData.Design;

namespace Volpe.Cafe.MarketData
{
    /// <summary>
    /// Represents a revision of a component, with descriptions of its engineering characteristics and compliance
    /// attributes for a specific model year.
    /// </summary>
    /// <seealso cref="OEMComponentFamily{T}"/>
    /// <seealso cref="BaselineComponentFamily"/>
    [Serializable]
    public class ComponentFamilyRevision : ProductRevision, IOEMComponentFamilyRevision
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentFamilyRevision"/> class for the specified model year,
        /// using the baseline values from the specified <see cref="IOEMComponentFamily"/>.
        /// </summary>
        /// <param name="year">The model year associated with this component revision.</param>
        /// <param name="family">
        ///     The underlying <see cref="IOEMComponentFamily"/> associated with this component revision.
        /// </param>
        public ComponentFamilyRevision(int year, IOEMComponentFamily family) : base(year, family) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentFamilyRevision"/> class for the specified model year,
        /// using the property values from the specified <see cref="IOEMComponentFamilyRevision"/>.
        /// </summary>
        /// <param name="year">The model year associated with this component revision.</param>
        /// <param name="revision">
        ///     The component family revision to use for initializing this instance. This value should represent the
        ///     component family's revision for a preceding model year.
        /// </param>
        public ComponentFamilyRevision(int year, IOEMComponentFamilyRevision revision) : base(year, revision) { }

        public IOEMComponentFamily ComponentFamily => (IOEMComponentFamily)this.Product;
        public new BaselineComponentFamily BaselineInfo => this.ComponentFamily.BaselineInfo;

        public string FamilyName => this.BaselineInfo.FamilyName;

    }
}
