namespace Nexus.Api.Models;

/// <summary>
/// Compact task representation used by the paged mission-control board.
/// Child tasks are represented by their own cards and linked through
/// <see cref="ParentTaskId"/> so the client can build the hierarchy in O(n).
/// </summary>
public sealed record TaskBoardCardDto(
    Guid Id,
    string Title,
    string? Detail,
    string Source,
    string State,
    string Priority,
    string? AssignedTo,
    Guid? ParentTaskId,
    Guid? ProjectId,
    DateTimeOffset? DueDate,
    DateTimeOffset CreatedAt,
    DateTimeOffset UpdatedAt,
    bool IsAgentTask,
    string? ExpectedFrom,
    string? LastActivityMessage,
    DateTimeOffset? LastActivityAt,
    int ChildTaskCount,
    int OpenChildTaskCount,
    bool HasVisibleDelegation);

/// <summary>
/// Initial task-board page. Active columns are complete; the Done column is
/// keyset-paginated by <c>(UpdatedAt DESC, Id DESC)</c>.
/// </summary>
public sealed record TaskBoardPageDto(
    string Revision,
    IReadOnlyList<TaskBoardCardDto> Offen,
    IReadOnlyList<TaskBoardCardDto> InProgress,
    IReadOnlyList<TaskBoardCardDto> Review,
    IReadOnlyList<TaskBoardCardDto> Blocked,
    IReadOnlyList<TaskBoardCardDto> Done,
    string? NextDoneCursor,
    bool HasMoreDone);
