using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using NPP.SmartSchedue.Api.Contracts.Core.Enums;

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

/// <summary>
/// 使用模板发送系统消息输入模型
/// </summary>
public class SendSystemMessageByTemplateInput
{
    /// <summary>
    /// 接收人员ID
    /// </summary>
    [Required(ErrorMessage = "接收人员ID不能为空")]
    [Range(1, long.MaxValue, ErrorMessage = "接收人员ID必须大于0")]
    public long RecipientPersonnelId { get; set; }

    /// <summary>
    /// 消息标题模板
    /// </summary>
    [Required(ErrorMessage = "消息标题模板不能为空")]
    [StringLength(200, ErrorMessage = "消息标题模板长度不能超过200个字符")]
    public string TitleTemplate { get; set; } = "";

    /// <summary>
    /// 消息内容模板
    /// </summary>
    [Required(ErrorMessage = "消息内容模板不能为空")]
    [StringLength(4000, ErrorMessage = "消息内容模板长度不能超过4000个字符")]
    public string ContentTemplate { get; set; } = "";

    /// <summary>
    /// 模板变量
    /// </summary>
    public Dictionary<string, string> Variables { get; set; } = new Dictionary<string, string>();

    /// <summary>
    /// 消息类型
    /// </summary>
    public SystemMessageTypeEnum MessageType { get; set; } = SystemMessageTypeEnum.Info;

    /// <summary>
    /// 业务类型
    /// </summary>
    [StringLength(100, ErrorMessage = "业务类型长度不能超过100个字符")]
    public string BusinessType { get; set; } = "";

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