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

namespace LifePayment.Domain
{
    public class OrderChangedBzContentInput
    {
        /// <summary>
        /// 商户端的唯一订单号
        /// </summary>
        [JsonProperty("out_biz_no", NullValueHandling = NullValueHandling.Ignore)]
        public string OutBizNo
        {
            get;
            set;
        }

        /// <summary>
        /// 销售产品码,商家和支付宝签约的产品码。 STD_RED_PACKET:现金红包; TRANS_ACCOUNT_NO_PWD:单笔无密转账
        /// </summary>
        [JsonProperty("product_code", NullValueHandling = NullValueHandling.Ignore)]
        public string ProductCode
        {
            get;
            set;
        }

        /// <summary>
        /// 描述特定的业务场景,如果传递了out_biz_no则该字段为必传。可取的业务场景如下: PERSONAL_PAY:C2C现金红包-发红包; PERSONAL_COLLECTION:C2C现金红包-领红包; REFUND:C2C现金红包-红包退回; DIRECT_TRANSFER:B2C现金红包、单笔无密转账
        /// </summary>
        [JsonProperty("biz_scene", NullValueHandling = NullValueHandling.Ignore)]
        public string BizScene
        {
            get;
            set;
        }

        /// <summary>
        /// 请求来源的接口
        /// </summary>
        [JsonProperty("origin_interface", NullValueHandling = NullValueHandling.Ignore)]
        public string OriginInterface
        {
            get;
            set;
        }

        /// <summary>
        /// 支付宝转账单据号
        /// </summary>
        [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)]
        public string OrderId
        {
            get;
            set;
        }

        /// <summary>
        /// 转账单据状态。可能出现的状态如下: SUCCESS:转账成功; WAIT_PAY:等待支付; CLOSED:订单超时关闭; REFUND:退票; DEALING:转账到银行卡处理中;
        /// FAIL:转账失败; alipay.fund.trans.app.pay涉及的状态: WAIT_PAY SUCCESS CLOSED alipay.fund.trans.uni.transfer、alipay.fund.trans.refund涉及的状态:SUCCESS REFUND DEALING FAIL 不同的转账接口涉及不同的单据状态,以实际场景为准
        /// </summary>
        [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
        public string Status
        {
            get;
            set;
        }

        /// <summary>
        /// 资金订单的操作类型, CREATE-创建; FINISH- 订单处理已完结 CLOSE-超时关闭 ;
        /// </summary>
        [JsonProperty("action_type", NullValueHandling = NullValueHandling.Ignore)]
        public string ActionType
        {
            get;
            set;
        }

        /// <summary>
        /// 转账金额,单位元
        /// </summary>
        [JsonProperty("trans_amount", NullValueHandling = NullValueHandling.Ignore)]
        public string TransAmount
        {
            get;
            set;
        }

        /// <summary>
        /// 金融机构发起签约类、支付类、差错类业务时,应为每笔业务分配唯一的交易流水号。31位交易流水号组成规则为:
        /// “8位日期”+“16位序列号”+“1位预留位”+“6位控制位”,其中: a)“8位日期”为系统当前日期,ISODate格式:“YYYYMMDD” b)
        /// “16位序列号”由金融机构生成,金融机构应确保该值在网联当日唯一 c)“1位预留位”由平台分配 d)“6位控制位”由金融机构通过平台获取 例如:2023052993044491260542090100400
        /// </summary>
        [JsonProperty("settle_serial_no", NullValueHandling = NullValueHandling.Ignore)]
        public string SettleSerialNo
        {
            get;
            set;
        }

        /// <summary>
        /// 失败子单具体状态
        /// </summary>
        [JsonProperty("sub_order_status", NullValueHandling = NullValueHandling.Ignore)]
        public string SubOrderStatus
        {
            get;
            set;
        }

        /// <summary>
        /// 特殊场景提供,当子单出现异常导致主单失败或者退款时,会提供此字段,用于透出子单具体的错误场景
        /// </summary>
        [JsonProperty("sub_order_error_code", NullValueHandling = NullValueHandling.Ignore)]
        public string SubOrderErrorCode
        {
            get;
            set;
        }

        /// <summary>
        /// 特殊场景提供,当子单出现异常导致主单失败或者退款时,会提供此字段,用于透出子单具体的错误场景
        /// </summary>
        [JsonProperty("sub_order_fail_reason", NullValueHandling = NullValueHandling.Ignore)]
        public string SubOrderFailReason
        {
            get;
            set;
        }

        /// <summary>
        /// 支付宝支付资金流水号,仅当转账成功才会返回该参数
        /// </summary>
        [JsonProperty("pay_fund_order_id", NullValueHandling = NullValueHandling.Ignore)]
        public string PayFundOrderId
        {
            get;
            set;
        }

        /// <summary>
        /// 支付完成时间
        /// </summary>
        [JsonProperty("pay_date", NullValueHandling = NullValueHandling.Ignore)]
        public string PayDate
        {
            get;
            set;
        }

        /// <summary>
        /// 自动退款时间
        /// </summary>
        [JsonProperty("refund_date", NullValueHandling = NullValueHandling.Ignore)]
        public string RefundDate
        {
            get;
            set;
        }

        /// <summary>
        /// 无忧收场景下的受理单号
        /// </summary>
        [JsonProperty("entrust_order_id", NullValueHandling = NullValueHandling.Ignore)]
        public string EntrustOrderId
        {
            get;
            set;
        }
    }

    public class FundOrderChangedInput
    {
        /// <summary>
        /// 通知ID
        /// </summary>
        [JsonProperty("notify_id", NullValueHandling = NullValueHandling.Ignore)]
        public string NotifyId
        {
            get;
            set;
        }

        /// <summary>
        /// 消息发送时的服务端时间
        /// </summary>
        [JsonProperty("utc_timestamp", NullValueHandling = NullValueHandling.Ignore)]
        public string UtcTimestamp
        {
            get;
            set;
        }

        /// <summary>
        /// 消息接口名称
        /// </summary>
        [JsonProperty("msg_method", NullValueHandling = NullValueHandling.Ignore)]
        public string MsgMethod
        {
            get;
            set;
        }

        /// <summary>
        /// 消息接受方的应用id
        /// </summary>
        [JsonProperty("app_id", NullValueHandling = NullValueHandling.Ignore)]
        public string AppId
        {
            get;
            set;
        }

        /// <summary>
        /// 版本号(1.1版本为标准消息)
        /// </summary>
        [JsonProperty("version", NullValueHandling = NullValueHandling.Ignore)]
        public string Version
        {
            get;
            set;
        }

        /// <summary>
        /// 消息报文
        /// </summary>
        [JsonProperty("biz_content", NullValueHandling = NullValueHandling.Ignore)]
        public OrderChangedBzContentInput BizContent
        {
            get;
            set;
        }

        /// <summary>
        /// 签名
        /// </summary>
        [JsonProperty("sign", NullValueHandling = NullValueHandling.Ignore)]
        public string Sign
        {
            get;
            set;
        }

        /// <summary>
        /// 签名类型
        /// </summary>
        [JsonProperty("sign_type", NullValueHandling = NullValueHandling.Ignore)]
        public string SignType
        {
            get;
            set;
        }

        /// <summary>
        /// 编码集,该字符集为验签和解密所需要的字符集
        /// </summary>
        [JsonProperty("charset", NullValueHandling = NullValueHandling.Ignore)]
        public string Charset
        {
            get;
            set;
        }
    }
}