using System;
using SqlSugar;

namespace MDL.Models
{
    [SugarTable("tag_templates")]
    public class TagTemplateEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        [SugarColumn(Length = 50, IsNullable = false, ColumnDescription = "标签类型，唯一")]
        public string TagType { get; set; }

        [SugarColumn(Length = 100, IsNullable = false)]
        public string Name { get; set; }

        [SugarColumn(ColumnDataType = "TEXT", IsNullable = false)]
        public string TemplateConfig { get; set; }

        [SugarColumn(ColumnDataType = "TEXT", IsNullable = false)]
        public string TriggerRule { get; set; }

        [SugarColumn(DefaultValue = "1")]
        public bool IsActive { get; set; } = true;

        [SugarColumn(IsNullable = false, DefaultValue = "CURRENT_TIMESTAMP")]
        public DateTime CreatedAt { get; set; } = DateTime.Now;

        [SugarColumn(IsNullable = false, DefaultValue = "CURRENT_TIMESTAMP")]
        public DateTime UpdatedAt { get; set; } = DateTime.Now;
    }
}
