using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Hc900Crawler.Core.Domain.Entities;

/// <summary>P&ID 태그 prefix → 카테고리 매핑 규칙</summary>
[Table("pid_prefix_rules")]
public class PidPrefixRule
{
    [Column("id")]
    public int Id { get; set; }

    [Required]
    [MaxLength(30)]
    [Column("prefix")]
    public string Prefix { get; set; } = string.Empty;

    [Required]
    [MaxLength(30)]
    [Column("category")]
    public string Category { get; set; } = string.Empty;

    [MaxLength(200)]
    [Column("description")]
    public string? Description { get; set; }

    [Column("sort_order")]
    public int SortOrder { get; set; }

    /// <summary>DCS 함수블록 여부: TRUE=FIC/TIC/PIC/FY 등 DCS 내부 블록, FALSE=FT/FCV 등 현장 계기</summary>
    [Column("tag_dcs")]
    public bool TagDcs { get; set; } = false;

    [Column("created_at")]
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

    [Column("updated_at")]
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
