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

namespace Hc900Crawler.Core.Domain.Entities;

/// <summary>P&ID 추출/수정 작업 감사 로그</summary>
[Table("pid_audit_log")]
public class PidAuditLog
{
    [Column("id")]
    public long Id { get; set; }

    // 사용자 인증 시스템 부재 → Source 필드로 대체
    [MaxLength(50)]
    [Column("source")]
    public string Source { get; set; } = string.Empty;

    [MaxLength(50)]
    [Column("action")]
    public string Action { get; set; } = string.Empty;

    [MaxLength(50)]
    [Column("target_tag_no")]
    public string TargetTagNo { get; set; } = string.Empty;

    [Column("old_value")]
    public string? OldValue { get; set; }

    [Column("new_value")]
    public string? NewValue { get; set; }

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