Разбить Deal.Modules.Cards по назначению

Application разделён на Abstractions (25 интерфейсов), Models (13
доменных типов) и Dtos (CardMoveResultDto); namespace приведён к путям,
using потребителей мигрированы.
This commit is contained in:
Rustam Khalimov
2026-09-11 13:16:57 +03:00
parent 8a7d7f2a7a
commit 31c434ed93
65 changed files with 231 additions and 66 deletions
@@ -0,0 +1,102 @@
using Deal.Modules.Cards.Application.Abstractions;
using Deal.Modules.Cards.Application.Dtos;
namespace Deal.Modules.Cards.Application.Models;
/// <summary>
/// Агрегат карточки: ядро + опциональные модули (единая сущность всех дашбордов).
/// </summary>
/// <remarks>
/// Один класс на карточку (не иерархия видов): вид определяется контейнером и наполненностью модулей,
/// а не типом. Модули — это секции данных (роли интерфейсов), пустые, пока карточка «входящая»,
/// наполняются, когда карточка «в работе» (файлы/ссылки/ТЗ/история/напоминания). Класс неизменяемый
/// (init/свойства только для чтения) — изменения применяются сервисами через порт и возвращают новый
/// снимок, как единая CardDto (wire 1:1 сохраняется).
/// </remarks>
public sealed class Card :
ICard,
IContentCard,
IBudgetedCard,
IContactCard,
IAttributedCard,
ICommentableCard,
ILinkCard,
IFileCard,
ITzCard,
ITraceableCard,
IRemindableCard,
ILocatedCard
{
/// <inheritdoc />
public string Id { get; init; } = string.Empty;
/// <inheritdoc />
public string Title { get; init; } = string.Empty;
/// <inheritdoc />
public ISource Source { get; init; } = null!;
// ── Модуль «содержимое» ──
/// <inheritdoc />
public string Summary { get; init; } = string.Empty;
// ── Модуль «бюджет» ──
/// <inheritdoc />
public CardBudget? Budget { get; init; }
// ── Модуль «контакты» ──
/// <inheritdoc />
public IReadOnlyList<CardContact> Contacts { get; init; } = Array.Empty<CardContact>();
/// <inheritdoc />
public string ContactText { get; init; } = string.Empty;
// ── Модуль «атрибуты» ──
/// <inheritdoc />
public IReadOnlyList<CardAttribute> Attributes { get; init; } = Array.Empty<CardAttribute>();
// ── Модуль «комментарии» ──
/// <inheritdoc />
public IReadOnlyList<CardComment> Comments { get; init; } = Array.Empty<CardComment>();
// ── Модуль «ссылки» ──
/// <inheritdoc />
public IReadOnlyList<CardLink> Links { get; init; } = Array.Empty<CardLink>();
// ── Модуль «файлы» ──
/// <inheritdoc />
public IReadOnlyList<CardFile> Files { get; init; } = Array.Empty<CardFile>();
// ── Модуль «ТЗ» ──
/// <inheritdoc />
public string TzText { get; init; } = string.Empty;
// ── Модуль «история движения» ──
/// <inheritdoc />
public IReadOnlyList<CardHistoryEntry> History { get; init; } = Array.Empty<CardHistoryEntry>();
// ── Модуль «напоминание» ──
/// <inheritdoc />
public CardReminder? Reminder { get; init; }
// ── Модуль «размещение» ──
/// <inheritdoc />
public string ContainerId { get; init; } = CardIds.Inbox;
/// <inheritdoc />
public string? PrevContainerId { get; init; }
/// <inheritdoc />
public bool IsNew { get; init; } = true;
}