
namespace Edge.Core.Domain.FccOrderInfo.Output
{
    /// <summary>
    /// fcc 订单页分页查询结果对象
    /// </summary>
    public class OrderInfoOutput
    {
        /// <summary>
        /// 总数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 订单
        /// </summary>
        public List<OrderInfo> List { get; set; }
        
    }

    /// <summary>
    /// fcc 订单页数据对象
    /// </summary>
    public class OrderInfo
    {
        public OrderInfo(FccOrderInfo fccOrderInfo)
        {
            this.Id = fccOrderInfo.Id;
            this.Ttc = fccOrderInfo.Ttc;
            this.AuthorizationTime = fccOrderInfo.AuthorizationTime;
            this.EndTime = fccOrderInfo.EndTime;
            this.PaymentTime = fccOrderInfo.PaymentTime;
            this.NozzleNum = fccOrderInfo.NozzleNum;
            this.OilName = fccOrderInfo.OilName;
            this.PaymentStatus = fccOrderInfo.PaymentStatus;
            this.PayType = fccOrderInfo.PayType;
            this.CloundOrderId = fccOrderInfo.CloundOrderId;
            this.Amount = fccOrderInfo.Amount;
            this.Volume = fccOrderInfo.Volume;
            this.AmountPayable = fccOrderInfo.AmountPayable;
            this.Price = fccOrderInfo.Price;
            this.RefundAmount = fccOrderInfo.RefundAmount;
            this.UserName = fccOrderInfo.UserName;
            this.PhoneNumber = fccOrderInfo.PhoneNumber;
            this.PaymentName = fccOrderInfo.PaymentName;
        }
        /// <summary>
        /// 订单id
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 流水号
        /// </summary>
        public int Ttc { get; set; }

        /// <summary>
        /// 授权时间
        /// </summary>
        public DateTime AuthorizationTime { get; set; }

        /// <summary>
        /// 挂枪时间
        /// </summary>
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 交易时间
        /// </summary>
        public DateTime? PaymentTime { get; set; }

        /// <summary>
        /// 枪号
        /// </summary>
        public int NozzleNum { get; set; }

        /// <summary>
        /// 油品名
        /// </summary>
        public String OilName { get; set; }

        /// <summary>
        /// 支付状态
        /// </summary>
        public int PaymentStatus { get; set; }

        /// <summary>
        /// 支付类型
        /// </summary>
        public int? PayType { get; set; }

        /// <summary>
        /// 云端id
        /// </summary>
        public long? CloundOrderId { get; set; }

        /// <summary>
        /// 实际加油金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 实际加油升数
        /// </summary>
        public decimal Volume { get; set; }

        /// <summary>
        /// 实际支付金额
        /// </summary>
        public decimal? AmountPayable { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal Price { get; set; }

        /// <summary>
        /// 退款金额
        /// </summary>
        public decimal? RefundAmount { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }


        /// <summary>
        /// 手机号
        /// </summary>
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 支付类型名称
        /// </summary>
        public string PaymentName { get; set; }

        public FccOrderInfo ToComponent()
        {
            return new FccOrderInfo
            {
                Ttc = this.Ttc,
                AuthorizationTime = this.AuthorizationTime,
                EndTime = this.EndTime,
                PaymentTime = this.PaymentTime,
                NozzleNum = this.NozzleNum,
                OilName = this.OilName,
                PaymentStatus = this.PaymentStatus,
                PayType = this.PayType,
                CloundOrderId = this.CloundOrderId,
                Amount = this.Amount,
                Volume = this.Volume,
                AmountPayable = this.AmountPayable,
                Price = this.Price,
                RefundAmount =  this.RefundAmount,
                UserName = this.UserName,
                PhoneNumber = this.PhoneNumber,
                PaymentName = this.PaymentName
            };
        }
    }
}
