using System;

namespace Dfs.WayneChina.PosModelMini
{
    public class PosTrxLineItem
    {
        /// <summary>
        /// Unique id the current POS Trx line item.
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// the index of Ringup sequence.
        /// </summary>
        public int LineNum { get; set; }

        /// <summary>
        /// Unique id of the POS item.
        /// </summary>
        public Guid PosItemId { get; set; }

        /// <summary>
        /// PosTrxItem link to a PosItem.
        /// </summary>
        public virtual PosItem Item { get; set; }

        /// <summary>
        /// Quantity
        /// </summary>
        public decimal Qty { get; set; }

        /// <summary>
        /// Whether the current line item is voided (excluded from current trx) or not.
        /// </summary>
        public bool Voided { get; set; }

        public Guid PosTrxId { get; set; }

        /// <summary>
        /// Belong to which PosTrx
        /// </summary>
        public virtual PosTrx PosTrx { get; set; }

        /// <summary>
        /// Gross amount.
        /// </summary>
        public decimal GrossAmount { get; set; }

        /// <summary>
        /// Indicates which pump the fuel item is sold.
        /// </summary>
        public int? FuelItemSoldOnPumpId { get; set; }

        /// <summary>
        /// Indicates which nozzle the fuel item is sold.
        /// </summary>
        public int? FuelItemSoldOnPumpNozzleId { get; set; }

        /// <summary>
        /// the amount which caculated by local FC, typically Fuel item's amount should not re-cacualted in server again(by Qty*Price, may cause rounding issue), 
        /// just trust the value from local.
        /// </summary>
        public decimal? FuelItemOriginalGrossAmount { get; set; }

        /// <summary>
        /// used for query, lock, unlock fuel trx from fdc server, only for fuel sale.
        /// </summary>
        public string FuelItemFdcTransactionSeqNo { get; set; }

        /// <summary>
        /// used for query, lock, unlock fuel trx from fdc server, only for fuel sale.
        /// </summary>
        public int? FuelItemFdcReleaseTokenAttribute { get; set; }
        //public virtual List<PosTrxDiscount> AppliedInPosTrxDiscounts { get; set; }

        /// <summary>
        /// Can be used to link any information, like attendant ID, etc.
        /// </summary>
        public string FuelItemTag { get; set; }

        /// <summary>
        /// Amount accumulation of the pump.
        /// </summary>
        public decimal? FuelItemPumpTotalizerMoney { get; set; }

        /// <summary>
        /// Volume accumulation of the pump.
        /// </summary>
        public decimal? FuelItemPumpTotalizerVolume { get; set; }

        /// <summary>
        /// Url to the QR code to get the electronic invoice.
        /// </summary>
        public string EInvoiceQrUrl { get; set; }
    }
}