corp-app/CORP-MAUI/Models/Department.cs

35 lines
1021 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Text.Json.Serialization;
namespace CORP_MAUI.Models;
/// <summary>
/// Модель отдела
/// </summary>
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; }
/// <summary>
/// Контейнер для аватарок сотрудников (используется в UI)
/// </summary>
[JsonIgnore]
public HorizontalStackLayout? AvatarsContainer { get; set; }
/// <summary>
/// Описание для отображения (с fallback если пусто)
/// </summary>
[JsonIgnore]
public string DisplayDescription =>
string.IsNullOrWhiteSpace(Description)
? "Описание отсутствует"
: Description;
}