using Hotline.Share.Enums.Snapshot;
using SqlSugar;
using System.ComponentModel;
using XF.Domain.Repository;
using Hotline.Orders;

namespace Hotline.Snapshot;

/// <summary>
/// 红包发放记录
/// </summary>
[Description("红包发放记录")]
public class RedPackRecord : CreationSoftDeleteEntity
{
    /// <summary>
    /// 关联工单编号
    /// <inheritdoc cref="Order"/>表的Id字段
    /// </summary>    
    [SugarColumn(ColumnDescription = "关联工单编号")]
    public string OrderId { get; set; }

    /// <summary>
    /// No
    /// </summary>
    [SugarColumn(ColumnDescription = "No")]
    public string No { get; set; }

    /// <summary>
    /// 红包审核Id
    /// <inheritdoc cref="RedPackAudit"/>
    /// </summary>
    [SugarColumn(ColumnDescription = "红包审核Id")]
    public string RedPackAuditId { get; set; }

    /// <summary>
    /// 微信返回的订单号
    /// </summary>
    [SugarColumn(ColumnDescription = "微信返回的订单号")]
    public string? WxOrderNo { get; set; }

    /// <summary>
    /// 红包金额(单位:元)
    /// </summary>
    [SugarColumn(ColumnDescription = "红包金额(单位:元)")]
    public double Amount {get;set;}

    /// <summary>
    /// 用户微信OpenId
    /// </summary>
    [SugarColumn(ColumnDescription = "用户微信OpenId")]
    public string? WXOpenId { get; set; }

    /// <summary>
    /// 红包领取人类型
    /// </summary>
    [SugarColumn(ColumnDescription = "红包领取人类型")]
    public EReadPackUserType PeopleType { get; set; }

    /// <summary>
    /// 领取人姓名
    /// </summary>
    [SugarColumn(ColumnDescription = "领取人姓名")]
    public string? Name { get; set; }

    /// <summary>
    /// 领取人电话号码
    /// </summary>
    [SugarColumn(ColumnDescription = "电话号码")]
    public string? PhoneNumber { get; set; }

    /// <summary>
    /// 商户号
    /// </summary>
    [SugarColumn(ColumnDescription = "商户号")]
    public string? MerchantCode { get; set; }

    /// <summary>
    /// 红包发放状态
    /// </summary>
    [SugarColumn(ColumnDescription = "红包发放状态")]
    public EReadPackSendStatus DistributionState {get;set;}

    /// <summary>
    /// 红包领取状态
    /// </summary>
    [SugarColumn(ColumnDescription = "红包领取状态")]
    public ERedPackPickupStatus? PickupStatus { get; set; }

    /// <summary>
    /// 发放失败原因
    /// </summary>
    public ERedPackPickupFailCase? FailCase { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注")]
    public string? Remark { get; set; }

    /// <summary>
    /// 红包领取时间
    /// </summary>
    [SugarColumn(ColumnDescription = "红包领取时间")]
    public DateTime? ReceiveTime { get; set; }

    /// <summary>
    /// 银行卡号
    /// </summary>
    [SugarColumn(ColumnDescription = "银行卡号")]
    public string? BankCardNo { get; set; }

    /// <summary>
    /// 开户行
    /// </summary>
    [SugarColumn(ColumnDescription = "开户行")]
    public string? OpenBank { get; set; }
}
