namespace ApiTerceiroSimulador.Models.OpenDelivery
{
    public class OrderItem
    {

        /// <summary>
        /// A unique identifier of the item.
        /// </summary>
        public required string Id { get; set; } // "497f6eca-6276-4993-bfeb-53cbbbba6f08",

        /// <summary>
        /// Item's position.
        /// </summary>
        public int Index { get; set; } //0,

        /// <summary>
        /// Product name
        /// </summary>
        public required string Name { get; set; }

        /// <summary>
        /// External product code.
        /// </summary>
        public required string ExternalCode { get; set; }

        /// <summary>
        /// Item's Unit of Measurement.
        /// Use fractional values for quantities smaller than the unit of measure: Example: 500 grams = 0.5 KG
        /// </summary>
        public required string Unit { get; set; } = ProductUnits.UN; //"KG",

        /// <summary>
        /// EAN is the barcode standard used on items.
        /// </summary>
        public string? Ean { get; set; }

        /// <summary>
        /// Amount of items.
        /// Use fractional values for quantities smaller than the unit of measure: Example: 500 grams = 0.5 KG
        /// </summary>
        public required decimal Quantity { get; set; } // 0,

        /// <summary>
        /// Special instructions about the items.
        /// </summary>
        public string? SpecialInstructions { get; set; }

        /// <summary>
        /// Price per unit. This is the price the customer is paying and will be considered for order totals calculations.
        /// </summary>
        public required PriceCurrency UnitPrice { get; set; }

        /// <summary>
        /// Original price of the product. This price is for information purposes only and should be used to inform the price of an item before applying markdowns on the list price.
        /// Discounts applied during the order such as coupons and vouchers should not be considered here.These must be reported in the discounts object.
        /// THIS PRICE WILL NOT BE CONSIDERED FOR ORDER TOTALS CALCULATIONS.
        /// </summary>
        public  PriceCurrency? OriginalPrice { get; set; }

        /// <summary>
        /// Indicates whether or not the unit price of the item has changed due to a scaled purchase (where the quantity of items purchased changes the value of the item). Default is false
        /// </summary>
        public bool ScalePriceApplied { get; set; } // true,

        /// <summary>
        /// The sum of the total prices of all options of the item.
        /// </summary>
        public PriceCurrency? OptionsPrice { get; set; }

        /// <summary>
        /// This price is for information purposes only and should be used to inform the total price for the quantity of items ordered, excluding additional options. (quantity * unitPrice)
        /// THIS PRICE WILL NOT BE CONSIDERED FOR ORDER TOTALS CALCULATIONS.
        /// </summary>
        public PriceCurrency? SubtotalPrice { get; set; }

        /// <summary>
        /// Total Price of the item. (quantity * (unitPrice + optionsPrice))
        /// </summary>
        public required PriceCurrency TotalPrice { get; set; }

        /// <summary>
        /// Item-related properties for when the order is of type INDOOR
        /// </summary>
        public OrderItemIndoor? Indoor { get; set; }

        /// <summary>
        /// The optional extras chosen by the consumer, related to this item.
        /// </summary>
        public List<OrderItemOption>? Options { get; set; }

        /// <summary>
        /// Information of item of Consumer
        /// </summary>
        public ConsumerItemInfo? ConsumerItemInfo { get; set; }
    }
}
