using e_suite.API.Common.models.@base;
using e_suite.Database.Core.Tables.UserManager;
using eSuite.Core.CustomFields;
using eSuite.Core.Miscellaneous;
using System.Text.Json.Serialization;
using e_suite.Database.Core.Tables.CustomFields;

namespace e_suite.API.Common.models;

public class EditCustomFields : CustomFieldBase
{
    [JsonPropertyName("id")]
    public GeneralIdRef Id { get; set; } = new GeneralIdRef();

}

[Patches(typeof(CustomField))]
public class PatchCustomFields
{
    [JsonPropertyName("fieldType")]
    [PatchMap(nameof(CustomField.FieldType))]
    public FieldType? FieldType { get; set; }

    //Todo add support for this
    //[JsonPropertyName("refElementId")]
    //public GeneralIdRef? RefElementId { get; set; }

    [JsonPropertyName("name")]
    [PatchMap(nameof(CustomField.Name))]
    public string? Name { get; set; } = string.Empty;

    [JsonPropertyName("defaultValue")]
    [PatchMap(nameof(CustomField.DefaultValue))]
    public string? DefaultValue { get; set; } = string.Empty;

    [JsonPropertyName("minEntries")]
    [PatchMap(nameof(CustomField.MinEntries))]
    public long? MinEntries { get; set; }

    [JsonPropertyName("maxEntries")]
    [PatchMap(nameof(CustomField.MaxEntries))]
    public long? MaxEntries { get; set; }

    //Todo add support for this
    //[JsonPropertyName("params")]
    //[PatchMap(nameof(CustomField.))]
    //public string? Parameters { get; set; } = string.Empty;
}