using Hotline.Share.Enums.Order;
using Hotline.Share.Enums.Snapshot;
using Hotline.Share.Requests;
using Hotline.Share.Tools;
using System.ComponentModel.DataAnnotations;
using XF.Utility.EnumExtensions;

namespace Hotline.Share.Dtos.Snapshot;
public class RedPackOutDto 
{
    /// <summary>
    /// 工单Id
    /// </summary>
    public string OrderId { get; set; }

    public string Title { get; set; }    
    public DateTime CreationTime { get; set; }
    public string CreationTimeText => CreationTime.ToString("yyyy-MM-dd HH:mm:ss");

    /// <summary>
    /// 金额(单位:元)
    /// </summary>
    public string AmountTxt => Amount.ToYuanFinance();

    /// <summary>
    /// 金额(单位:元)
    /// </summary>
    public double Amount { get; set; }

    /// <summary>
    /// 红包审核Id
    /// </summary>
    public string RedPackAuditId { get; set; }
}

public class RedPacksInDto : QueryFixedDto
{ 
    /// <summary>
    /// 时间; 格式:yyyy-MM
    /// </summary>
    [Required]
    public string Time { get; set; } = DateTime.Now.ToString("yyyy-MM");

    /// <summary>
    /// 红包状态
    /// </summary>
    public ERedPackPickupStatus Status { get; set; }
}

public class RedPackDateInDto 
{
    /// <summary>
    /// 红包状态
    /// </summary>
    public ERedPackPickupStatus Status { get; set; }
}

public class RedPackDateOutDto
{ 
    /// <summary>
    /// 时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    public string CreationTimeText => CreationTime.ToString("yyyy-MM");

    /// <summary>
    /// 金额(单位:元)
    /// </summary>
    public double Amount { get; set; }

    /// <summary>
    /// 金额(单位:元)
    /// </summary>
    public string AmountTxt => Amount.ToYuanFinance();
}

public class UpdateRedPackAuditRemarkInDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string RedPackAuditId { get; set; }

    /// <summary>
    /// 实发金额
    /// </summary>
    public double AcutalAmount { get; set; }

    /// <summary>
    /// 市民奖励发放备注
    /// </summary>
    public string SendRemarks { get; set; }

    /// <summary>
    /// 市民奖励发放结果
    /// </summary>
    public bool IsSend { get; set; }

    /// <summary>
    /// 红包发放失败原因;
    /// 0: 无法联系;
    /// 1: 婉拒红包;
    /// </summary>
    public ERedPackPickupFailCase? FailCase { get; set; }
}

public class UpdateRedPackRecordInDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string RedPackAuditId { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 银行卡号
    /// </summary>
    public string? BankCardNo { get; set; }

    /// <summary>
    /// 开户行
    /// </summary>
    public string? OpenBank { get; set; }

    /// <summary>
    /// 补充发放金额
    /// </summary>
    public double? ReplenishAmount { get; set; }

    /// <summary>
    /// 补充发放时间
    /// </summary>
    public DateTime? ReplenishTime { get; set; }

    /// <summary>
    /// 补充发放备注
    /// </summary>
    public string ReplenishRemark { get; set; }

    /// <summary>
    /// 发送短信
    /// </summary>
    public bool IsSendSMS { get; set; }

    /// <summary>
    /// 补充发放类型
    /// </summary>
    public string ReplenishType { get; set; }

    /// <summary>
    /// 补充发放类型Id
    /// </summary>
    public string ReplenishTypeId { get; set; }

    public string AuditType { get; set; }
}


/// <summary>
/// 补充发放OutDto
/// </summary>
public class SnapshotRedPackRecordSupplementItemsOutDto
{
    /// <summary>
    /// OrderId
    /// </summary>
    public string OrderId { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 来源
    /// </summary>
    public string SourceChannel { get; set; }

    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 行业
    /// </summary>
    public string IndustryName { get; set; }

    /// <summary>
    /// 来电人电话
    /// </summary>
    public string FromPhone { get; set; }

    /// <summary>
    /// 来电人姓名
    /// </summary>
    public string FromName { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 补发金额
    /// </summary>
    public double ReplenishAmount { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 卡号
    /// </summary>
    public string BankCardNo { get; set; }

    /// <summary>
    /// 开户行
    /// </summary>
    public string OpenBank { get; set; }

    /// <summary>
    /// 补发放时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 补充发放人员
    /// </summary>
    public string CreatorName { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string Remark { get; set; }

    /// <summary>
    /// 补充发放类型
    /// </summary>
    public string? ReplenishType { get; set; }

    /// <summary>
    /// 补充发放类型Id
    /// </summary>
    public string? ReplenishTypeId { get; set; }

    /// <summary>
    /// 补充奖励类型
    /// </summary>
    public string AuditType { get; set; }

    /// <summary>
    /// 补充奖励类型Code
    /// </summary>
    public string AuditTypeCode { get; set; }
}

public record SnapshotRedPackRecordSupplementItemsInDto : PagedRequest
{
    /// <summary>
    /// 受理编号
    /// </summary>
    public string? No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 来电人电话
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 发送时间
    /// </summary>
    public DateTime? BeginCreationTime { get; set; }

    /// <summary>
    /// 发送时间
    /// </summary>
    public DateTime? EndCreationTime { get; set; }

    /// <summary>
    /// 行业类型
    /// </summary>
    public string? IndustryId { get; set; }
}
