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 Microsoft.EntityFrameworkCore;

namespace e_suite.Database.Core.Tables.CustomFields;

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

    public long CustomFieldId { get; set; }
    [Precision(28, 8)]
    public decimal? MinimumValue { get; set; }
    [Precision(28, 8)]
    public decimal? MaximumValue { get; set; }
    [Precision(28, 8)]
    public decimal? Step { get; set; }

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

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