using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using e_suite.Database.Audit.Attributes;
using e_suite.Database.Audit.Models;

namespace e_suite.Database.Audit.Tables.Audit;

[NoAudit]
[Table("AuditEntries", Schema = "Audit")]
public class AuditEntry : IId
{
    [Key]
    public long Id { get; set; }

    [Required]
    public long AuditLogId { get; set; }

    [Required]
    public string EntityName { get; set; } = null!;

    [Required]
    public string PrimaryKey { get; set; } = string.Empty;

    [Required]
    public string? DisplayName { get; set; } = string.Empty;

    [Required]
    public bool IsPrimary { get; set; } = false;


    [ForeignKey(nameof(AuditLogId))]
    public virtual AuditDetail AuditLog { get; set; } = null!;
}