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

namespace e_suite.Database.Core.Tables.CustomFields;

[DisplayName("Custom Field Glossary")]
[Table("CustomFieldGlossaries", Schema = "CustomFields")]
public class CustomFieldGlossary : IId
{
    [Key]
    public long Id { get; set; }

    public long CustomFieldId { get; set; }

    public long GlossaryId { get; set; }

    [AuditLastUpdated]
    public DateTimeOffset LastUpdated { get; set; }

    [AuditParent]
    [ForeignKey(nameof(CustomFieldId))]
    public virtual CustomField CustomField { get; set; } = null!;

    [ForeignKey(nameof(GlossaryId))]
    public virtual Glossary Glossary { get; set; } = null!;
}