using Com.Bocom.OpenApi;
using Kivii;
using Kivii.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Njzj.Bocoms.Openapis.Entities
{
    [Api(Description = "收款码")]
    [Alias(Configs.TableNameReceiveCode)]
    public class ReceiveCode : EntityWithMetadata
    {
        [ApiMember(Description = "交易标识")]
        [StringLength(100)]
        public string trans_code { get; set; }

        [ApiMember(Description = "返回码")]
        [StringLength(100)]
        public string response_code { get; set; }

        [ApiMember(Description = "交易状态 P-处理中  F-失败  S-成功")]
        [StringLength(100)]
        public string response_status { get; set; }

        [ApiMember(Description = "响应时间")]
        [StringLength(100)]
        public string response_time { get; set; }

        [ApiMember(Description = "返回码描述")]
        [StringLength(200)]
        public string response_msg { get; set; }

        [ApiMember(Description = "门店识别号")]
        [StringLength(200)]
        public string shop_id { get; set; }

        [ApiMember(Description = "商户交易编号")]
        [Unique,IgnoreUpdate]
        [StringLength(200)]
        public string pay_mer_tran_no { get; set; }

        [ApiMember(Description = "收款二维码文本")]
        [StringLength(500)]
        public string display_code_text { get; set; }


        /// <summary>
        /// PROCESS 处理中 SUCCESS 交易成功 FAILURE 交易失败
        /// </summary>
        [ApiMember(Description = "交易最终结果")]
        [StringLength(200)]
        public string tran_state { get; set; }

        [ApiMember(Description = "交易状态码")]
        [StringLength(200)]
        public string tran_state_code { get; set; }

        [ApiMember(Description = "交易状态提示")]
        [StringLength(200)]
        public string tran_state_msg { get; set; }

        [ApiMember(Description = "商户内部备注")]
        [StringLength(200)]
        public string mer_memo { get; set; }

        [ApiMember(Description = "商户订单总金额")]
        [StringLength(200)]
        public string total_amount { get; set; }

        /// <summary>
        /// INITIAL初始化 PAIED交易成功 WAITPAY等待支付 REFUNDED部分退款 REFUNDALL全部退款 CLOSED订单关闭
        /// </summary>
        [ApiMember(Description = "订单状态")]
        [StringLength(200)]
        public string order_status { get; set; }

        [ApiMember(Description = "交易内容")]
        [StringLength(500)]
        public string tran_content { get; set; }

    }

    [Api(Description = "收款码明细")]
    [Alias(Configs.TableNameReceiveCodeDetail)]
    public class ReceiveCodeDetail : EntityWithMetadata
    {
        [DefaultEmptyGuid]
        public Guid ReceiveCodeKvid { get; set; }

        [ApiMember(Description = "商户交易编号")]
        [StringLength(200)]
        public string PayMerTranNo { get; set; }

        [ApiMember(Description = "付款单位")]
        [StringLength(500)]
        public string PayerName { get; set; }

        [IgnoreUpdate]
        [DefaultEmptyGuid]
        public Guid BizKvid { get; set; }

        [ApiMember(Description = "业务流水号")]
        [IgnoreUpdate]
        [StringLength(200)]
        public string BizId { get; set; }

        [ApiMember(Description = "业务类型")]
        [IgnoreUpdate]
        [StringLength(100)]
        public string BizType { get; set; }
    }
}
