namespace ApiTerceiroSimulador.Models.OpenDelivery
{
    /// <summary>
    /// Ver detalhes da documentação em https://abrasel-nacional.github.io/docs/#tag/ordersDetails/operation/ordersDetails
    /// </summary>
    public class OrderDetail
    {
        /// <summary>
        /// The unique identifier of the order. The order ID is generated by the Ordering Application.
        /// </summary>
        public required string Id { get; set; } // "497f6eca-6276-4993-bfeb-53cbbbba6f08",

        /// <summary>
        /// Enum: "DELIVERY" "TAKEOUT" "INDOOR"
        /// </summary>
        public required string Type { get; set; } = OrderTypes.Delivery; //"DELIVERY",

        /// <summary>
        /// Order Id shown in the Ordering Application interface for the customer.
        /// </summary>
        public required string DisplayId { get; set; }

        /// <summary>
        /// This field must be filled in with the AppId of the Ordering Application that originated the order. This field is to help the applications that will work as a Hub, intermediating the requests from the Ordering Application with the Software Service.
        /// </summary>
        public string? SourceAppId { get; set; }// "fb08c6b7-a844-43c6-b104-98e70c00fc20",

        /// <summary>
        /// You can indicate through which sales channel this order originated.
        /// </summary>
        public string? SalesChannel { get; set; }

        /// <summary>
        /// This field can be used as an alternative id for the merchant, in cases where the same merchant has different identifications or brands (such as dark kitchens). It is important to note that the Ordering Application or Software Hub must know this Id beforehand.
        /// </summary>
        public string? VirtualBrand { get; set; }

        /// <summary>
        /// Order creation date and time.
        /// </summary>
        public required string CreatedAt { get; set; } // "2019-08-24T14:15:22Z",

        /// <summary>
        /// The last valid event polled (whether acknowledged or not) or sent via webhook. Click here for definitions of each type.
        /// </summary>
        public string? LastEvent { get; set; } = OrderEvents.Created; // "CREATED",

        /// <summary>
        /// Indicates the timing for initiating the order
        /// </summary>
        public required string OrderTiming { get; set; } = OrderTimings.Instant; // "INSTANT",

        /// <summary>
        /// Suggestion for the preparation start time after Order creation. This can be used by the Ordering Application to inform the merchant to delay the start of the preparation for any reason. Default is the same time as the order creation time.
        /// </summary>
        public required string PreparationStartDateTime { get; set; }// "2019-08-24T14:15:22Z",

        /// <summary>
        /// Merchant information.
        /// </summary>
        public required Merchant Merchant { get; set; } // "merchant": {"id": "22815773000169-dbc7e35a-c936-4665-9e13-eb55eb8b6824", "name": "Pizza Plaza"},

        /// <summary>
        /// Order items.
        /// </summary>
        public required List<OrderItem> Items { get; set; }

        /// <summary>
        /// Other fees that may apply.
        /// </summary>
        public List<Fee>? OtherFees { get; set; }

        /// <summary>
        /// Any discounts that may apply.
        /// </summary>
        public List<Discount>? Discounts { get; set; }

        /// <summary>
        /// Set of fields with the sum of the values previously described in the order.
        /// </summary>
        public required OrderTotal Total { get; set; }

        /// <summary>
        /// All the description of the payment, such as methods, pre-payments, change, etc.
        /// </summary>
        public required Payment Payments { get; set; }

        /// <summary>
        /// Tax Invoice information.
        /// </summary>
        public TaxInvoice? TaxInvoice { get; set; }

        /// <summary>
        /// Customer related information.
        /// REQUIRED if the chosen type is DELIVERY
        /// </summary>
        public Customer? Customer { get; set; }

        /// <summary>
        /// Information for scheduled orders.
        /// REQUIRED if orderTiming is SCHEDULED.
        /// </summary>
        public Schedule? Schedule { get; set; }

        /// <summary>
        /// Defines the priority of preparation and delivery of this order in relation to other orders from the same Ordering Application.
        /// </summary>
        public string OrderPriority { get; set; } = OrderPriorities.Priority1;

        /// <summary>
        /// Information for DELIVERY orders.
        /// REQUIRED if the chosen type is DELIVERY
        /// </summary>
        public Delivery? Delivery { get; set; }

        /// <summary>
        /// Information for TAKEOUT orders.
        /// REQUIRED if the chosen type is TAKEOUT
        /// </summary>
        public Takeout? Takeout { get; set; }

        /// <summary>
        /// Information for INDOOR orders.
        /// REQUIRED if the chosen type is INDOOR
        /// </summary>
        public Indoor? Indoor { get; set; }

        /// <summary>
        /// This field indicates whether it is necessary for the Software Service to make a request to the POST /v1/orders/{orderId}/preparing endpoint to indicate to the Ordering Application that the order is in production.
        ///     true: Indicates that the Ordering Application is waiting for a request.
        ///     false or not informed: It is not required to make a request.
        /// </summary>
        public bool SendPreparing { get; set; } // true,

        /// <summary>
        /// This field indicates whether it is necessary for the Software Service to make a request to the POST /v1/orders/{orderId}/delivered endpoint to indicate to the Ordering Application that the order has been delivered to the client.
        ///     true: Indicates that the Ordering Application is waiting for a request.
        ///     false or not informed: It is not required to make a request.
        /// </summary>
        public bool SendDelivered { get; set; } // true,

        /// <summary>
        /// This field indicates whether it is necessary for the Software Service to make a request to the POST /v1/orders/{orderId}/pickedUp endpoint to indicate to the Ordering Application that the order has been picked up by the client.
        ///     true: Indicates that the Ordering Application is waiting for a request.
        ///     false or not informed: It is not required to make a request.
        /// </summary>
        public bool SendPickedUp { get; set; } // true,

        /// <summary>
        /// This field indicates whether it is necessary for the Software Service to make a request to the POST /v1/orders/{orderId}/tracking endpoint to inform the Ordering Application about delivery updates.
        ///     true: Indicates that the Ordering Application is waiting for a request.
        ///     false or not informed: It is not required to make a request.
        /// </summary>
        public bool SendTracking { get; set; } // true,

        /// <summary>
        /// Extra information, if necessary.
        /// </summary>
        public string? ExtraInfo { get; set; }
    }
}
