using System.Text.Json.Serialization;
using MilitaryTrainingManagement.Models.Enums;

namespace MilitaryTrainingManagement.Models.Entities;

/// <summary>
/// 组织单位实体
/// </summary>
public class OrganizationalUnit
{
    public int Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public OrganizationalLevel Level { get; set; }
    public int? ParentId { get; set; }
    
    [JsonIgnore]
    public OrganizationalUnit? Parent { get; set; }
    
    public List<OrganizationalUnit> Children { get; set; } = new();
    
    [JsonIgnore]
    public List<UserAccount> Accounts { get; set; } = new();
    
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
