using System;
using NPP.SmartSchedue.Api.Contracts.Core.Enums;

namespace NPP.SmartSchedue.Api.Contracts.Services.Notification.Output;

/// <summary>
/// 通知历史记录输出
/// </summary>
public class NotificationHistoryOutput
{
    #region 基础信息
    
    /// <summary>
    /// 通知历史记录ID
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 通知设置ID
    /// </summary>
    public long NotificationSettingId { get; set; }

    /// <summary>
    /// 通知设置名称
    /// </summary>
    public string NotificationSettingName { get; set; } = "";

    #endregion

    #region 接收人信息
    
    /// <summary>
    /// 接收人员ID
    /// </summary>
    public long RecipientPersonnelId { get; set; }

    /// <summary>
    /// 接收人员姓名
    /// </summary>
    public string RecipientPersonnelName { get; set; } = "";

    /// <summary>
    /// 接收人员邮箱
    /// </summary>
    public string RecipientEmail { get; set; } = "";

    #endregion

    #region 通知内容
    
    /// <summary>
    /// 通知方式
    /// </summary>
    public NotificationTypeEnum NotificationType { get; set; }

    /// <summary>
    /// 通知标题
    /// </summary>
    public string NotificationTitle { get; set; } = "";

    /// <summary>
    /// 通知内容
    /// </summary>
    public string NotificationContent { get; set; } = "";

    #endregion

    #region 发送信息
    
    /// <summary>
    /// 计划发送时间
    /// </summary>
    public DateTime PlannedSendTime { get; set; }

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

    /// <summary>
    /// 发送状态
    /// </summary>
    public NotificationStatusEnum SendStatus { get; set; } = NotificationStatusEnum.Pending;

    /// <summary>
    /// 发送结果信息
    /// </summary>
    public string SendResult { get; set; } = "";

    /// <summary>
    /// 错误信息
    /// </summary>
    public string ErrorMessage { get; set; } = "";

    #endregion

    #region 重试机制
    
    /// <summary>
    /// 重试次数
    /// </summary>
    public int RetryCount { get; set; } = 0;

    /// <summary>
    /// 最大重试次数
    /// </summary>
    public int MaxRetryCount { get; set; } = 3;

    /// <summary>
    /// 下次重试时间
    /// </summary>
    public DateTime? NextRetryTime { get; set; }

    #endregion

    #region 业务上下文
    
    /// <summary>
    /// 业务类型
    /// </summary>
    public string BusinessType { get; set; } = "";

    /// <summary>
    /// 业务ID
    /// </summary>
    public long? BusinessId { get; set; }

    /// <summary>
    /// 业务数据
    /// </summary>
    public string BusinessData { get; set; } = "";

    #endregion

    #region 时间信息
    
    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedTime { get; set; }

    #endregion
}