using System.Text.Json.Serialization;
namespace CORP_MAUI.Models;
///
/// Модель отдела
///
public class Department
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public int? Parent { get; set; }
[JsonPropertyName("employees_count")]
public int EmployeesCount { get; set; }
public User? Head { get; set; }
///
/// Контейнер для аватарок сотрудников (используется в UI)
///
[JsonIgnore]
public HorizontalStackLayout? AvatarsContainer { get; set; }
///
/// Описание для отображения (с fallback если пусто)
///
[JsonIgnore]
public string DisplayDescription =>
string.IsNullOrWhiteSpace(Description)
? "Описание отсутствует"
: Description;
}