using e_suite.Database.Core.Tables.CustomFields;
using eSuite.Core.CustomFields;
using eSuite.Core.Miscellaneous;

namespace e_suite.API.Common.models;

public class CustomFieldDefinition
{
    public CustomFieldDefinition()
    {

    }

    public CustomFieldDefinition(CustomField customField)
    {
        Id = customField.Id;
        Guid = customField.Guid;
        Name = customField.Name;
        FieldType = customField.FieldType;
        DefaultValue = customField.DefaultValue;
        MinEntries = customField.MinEntries;
        MaxEntries = customField.MaxEntries;
    }

    public long Id { get; set; }

    public string Name { get; set; } = string.Empty;

    public FieldType FieldType { get; set; }

    public string DefaultValue { get; set; } = string.Empty;

    public long MinEntries { get; set; } = 1;
    public long? MaxEntries { get; set; }

    public IGeneralIdRef? RefElementId { get; set; }
    public string? Parameters { get; set; }
    public Guid Guid { get; set; }
}
