//-----------------------------------------------------------------------
//
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
//
//-----------------------------------------------------------------------
namespace AliasClientDb;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using AliasClientDb.Abstracts;
///
/// Folder entity for hierarchical organization of items.
///
public class Folder : SyncableEntity
{
///
/// Gets or sets the folder ID.
///
[Key]
public Guid Id { get; set; }
///
/// Gets or sets the folder name.
///
[Required]
[StringLength(255)]
public string Name { get; set; } = string.Empty;
///
/// Gets or sets the parent folder ID foreign key.
///
public Guid? ParentFolderId { get; set; }
///
/// Gets or sets the parent folder object.
///
[ForeignKey("ParentFolderId")]
public virtual Folder? ParentFolder { get; set; }
///
/// Gets or sets the weight for sorting folders in the UI.
///
public int Weight { get; set; } = 0;
///
/// Gets or sets the child folders.
///
public virtual ICollection ChildFolders { get; set; } = [];
///
/// Gets or sets the items in this folder.
///
public virtual ICollection- Items { get; set; } = [];
}