using APT.BaseData.Domain.Enums;
using APT.Infrastructure.Core;
using System;
using System.ComponentModel;

namespace APT.BaseData.Domain.Entities.FM
{
    /// <summary>
    /// 信息通知表
    /// 预计每分钟执行一次信息发送
    /// </summary>
    [Description("信息通知表")]
    public partial class T_FM_NOTICE : MesEntityBase
    {

        /// <summary>
        /// 标记符 同类同组发送
        /// </summary>
        [Description("标记符")]
        public Guid KEY { get; set; }

        /// <summary>
        /// 通知类型
        /// </summary>
        [Description("通知类型")]
        public NOTICETYPE NOTICETYPE { get; set; }

        /// <summary>
        /// 短信模板ID
        /// </summary>
        [Description("短信模板ID")]
        [FormFieldTable]
        [DataFieldLength(50)]
        public string TEMPLATE_ID { get; set; }

        /// <summary>
        /// 表名称
        /// </summary>
        [Description("表名称")]
        [DataFieldLength(60)]
        public string TABLENAME { get; set; }

        /// <summary>
        /// 关联
        /// </summary>
        [Description("关联")]
        public Guid? DATA_ID { get; set; }

        /// <summary>
        /// 用户
        /// </summary>
        [Description("用户")]
        public Guid? USER_ID { get; set; }

        /// <summary>
        /// 通知人
        /// </summary>
        [Description("通知人")]
        [DataFieldLength(50)]
        [FormFieldTable]
        [FormFieldQuery]
        public string USERNAME { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        [Description("电话号码")]
        [FormFieldTable]
        [FormFieldQuery]
        [DataFieldLength(20)]
        public string TEL { get; set; }

        /// <summary>
        /// 通知状态
        /// </summary>
        [Description("通知状态")]
        [FormFieldTable]
        [FormFieldQuery]
        public FMNoticeStatus NOTICE_STATUS { get; set; } = FMNoticeStatus.等待发送;

        /// <summary>
        /// 尝试发送次数 从1开始 每次失败 ++
        /// </summary>
        [Description("尝试发送次数")]
        [FormFieldTable]
        public int TRYCOUNT { get; set; } = 3;

        /// <summary>
        /// 错误提示(第三次失败 写入返参)
        /// </summary>
        [Description("错误提示")]
        [DataFieldLength(100)]
        public string ERRORMSG { get; set; }



        /// <summary>
        /// 通知内容 
        /// </summary>
        [Description("通知内容")]
        [DataFieldLength(300)]
        [FormFieldTable]
        public string MESSAGE { get; set; }

        /// <summary>
        /// 通知内容
        /// </summary>
        [Description("任务名称")]
        [DataFieldLength(200)]
        [FormFieldTable]
        [FormFieldQuery]
        public string TITLE { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [Description("结束时间")]
        [FormFieldTable]
        [FormFieldQuery]
        public DateTime? ENDDT { get; set; }



        /// <summary>
        /// 原有保留 FMNoticeType
        /// </summary>
        [Description("原有保留")]
        public int? NOTICE_TYPE { get; set; }

        /// <summary>
        /// 原有保留 FMMessageType
        /// </summary>
        [Description("原有保留")]
        public int Message_TYPE { get; set; }

    }
}
