//----------------------------------------------------------------------- // // Copyright (c) aliasvault. All rights reserved. // Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information. // //----------------------------------------------------------------------- namespace AliasVault.Client.Main.Models; using System; using AliasClientDb.Models; /// /// Represents a field for editing in the UI. /// Unifies both system fields (from SystemFieldRegistry) and custom fields for the edit form. /// public sealed class SystemFieldEdit { /// /// Gets or sets the field key. /// For system fields: the system field key (e.g., 'login.username'). /// For custom fields: the FieldDefinitionId as a string. /// public string FieldKey { get; set; } = string.Empty; /// /// Gets or sets the field value ID (for existing fields only). /// public Guid FieldValueId { get; set; } /// /// Gets or sets the field definition ID (for custom fields only). /// public Guid? FieldDefinitionId { get; set; } /// /// Gets or sets the temporary ID for new custom fields (a GUID string). /// public string? TempId { get; set; } /// /// Gets or sets the label for this field. /// For system fields, this is the field key (UI layer translates via fieldLabels.*). /// For custom fields, this is the user-defined label. /// public string Label { get; set; } = string.Empty; /// /// Gets or sets the field type for rendering (Text, Password, Email, URL, Date, etc.). /// public string FieldType { get; set; } = "Text"; /// /// Gets or sets the field value. /// For single-value fields, use Value property. /// For multi-value fields, use Values property. /// public string Value { get; set; } = string.Empty; /// /// Gets or sets the field values for multi-value fields. /// public List Values { get; set; } = new(); /// /// Gets or sets a value indicating whether this is a custom field. /// public bool IsCustomField { get; set; } /// /// Gets or sets a value indicating whether the field is hidden/masked. /// public bool IsHidden { get; set; } /// /// Gets or sets a value indicating whether history is enabled for this field. /// public bool EnableHistory { get; set; } /// /// Gets or sets the display order. /// public int DisplayOrder { get; set; } /// /// Gets or sets the field category. /// public FieldCategory Category { get; set; } /// /// Gets or sets a value indicating whether the field supports multiple values. /// public bool IsMultiValue { get; set; } }