#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="OEMComponent{T}"/>
    /// <seealso cref="BaselineComponent"/>
    [Serializable]
    public class ComponentRevision : ProductRevision, IOEMComponentRevision
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentRevision"/> class for the specified model year, using
        /// the baseline values from the specified <see cref="IOEMComponent"/>.
        /// </summary>
        /// <param name="year">The model year associated with this component revision.</param>
        /// <param name="component">
        ///     The underlying <see cref="IOEMComponent"/> associated with this component revision.
        /// </param>
        public ComponentRevision(int year, IOEMComponent component) : base(year, component) { }

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

        public IOEMComponent Component => (IOEMComponent)this.Product;
        public new BaselineComponent BaselineInfo => this.Component.BaselineInfo;

        public string ComponentName => this.BaselineInfo.ComponentName;
        public string FamilyName => this.BaselineInfo.FamilyName;

    }
}
