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.Forms;

namespace e_suite.Database.Core.Tables.CustomFields;

[DisplayName("Custom Field Form Template")]
[Table("CustomFieldFormTemplates", Schema = "CustomFields")]
public class CustomFieldFormTemplate : IId
{
    [Key]
    public long Id { get; set; }

    public long CustomFieldId { get; set; }

    public long FormTemplateId { get; set; }

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

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

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