using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HengshanPaymentTerminal.Http.Response
{
    /// <summary>
    /// 云端响应数据对象
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class Response<T>
    {
        public int? statusCode {  get; set; }
        public bool? result {  get; set; }

        public string? message { get; set; }

        public T? data { get; set; }

    }

    public class CreateTransactionResponse
    {
        /// <summary>
        /// 订单唯一标识符
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 油站唯一标识符
        /// </summary>
        public Guid Buid { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public long MiniProgramID { get; set; }

        /// <summary>
        /// 枪号
        /// </summary>
        public long NozzleId { get; set; }

        /// <summary>
        /// 油品ID
        /// </summary>
        public long ProductId { get; set; }

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

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

        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateBy { get; set; }

        /// <summary>
        /// 订单创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

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

        /// <summary>
        /// 是否删除
        /// </summary>
        public sbyte? IsDeleted { get; set; } = 0;

        /// <summary>
        /// 订单状态
        /// </summary>
        public transactionsORDERSTATUS OrderStatus { get; set; }

        /// <summary>
        /// 订单类型
        /// </summary>
        public transactionsORDERTYPE OrderType { get; set; }

        /// <summary>
        /// 原金额
        /// </summary>
        public decimal? OriginalAmount { get; set; }

        /// <summary>
        /// 支付方式
        /// </summary>
        public long? PaymentMethod { get; set; }

        /// <summary>
        /// 油品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 原升数
        /// </summary>
        public decimal Qty { get; set; }

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

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

        /// <summary>
        /// 订单流水号
        /// </summary>
        public string TransactionNumber { get; set; }

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

        /// <summary>
        /// 加密字符串，用于验证金额是否篡改
        /// </summary>
        public string secret { get; set; }

        /// <summary>
        /// 支付返回结果
        /// </summary>
        public string RawResult { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        public string ErrorDetail { get; set; }

        /// <summary>
        /// 支付结果代码
        /// </summary>
        public string ResultCode { get; set; }

        /// <summary>
        /// 是否授权
        /// </summary>
        public AuthorizationStatus authorizationStatus { get; set; }

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

    }

    public enum AuthorizationStatus

    {
        /// <summary>
        /// 未授权
        /// </summary>
        Unauthorized,

        /// <summary>
        /// 授权
        /// </summary>
        Authorized

    }

    public enum transactionsORDERSTATUS

    {
        /// <summary>
        /// 订单未支付。
        /// </summary>
        Unpaid,

        /// <summary>
        /// 订单已支付。
        /// </summary>
        Paid,

        /// <summary>
        /// 订单正在支付中。
        /// </summary>
        //Paying,

        /// <summary>
        /// 订单全额退款。
        /// </summary>
        FullyRefunded,

        /// <summary>
        /// 订单部分退款。
        /// </summary>
        PartiallyRefunded,

        /// <summary>
        /// 订单通过卡支付。
        /// </summary>
        CardPayment

    }

    /// <summary>
    /// 表示交易订单的类型。
    /// </summary>
    public enum transactionsORDERTYPE

    {
        /// <summary>
        /// 预支付订单。
        /// </summary>
        Prepayment,

        /// <summary>
        /// 后支付订单。
        /// </summary>
        Postpayment
    }

}
