using Workflow.Domain.Enums;

namespace Workflow.Application.Features.WorkflowInstances.DTOs;

public record WorkflowInstanceDto(
    Guid Id,
    Guid DefinitionId,
    string Title,
    InstanceStatus Status,
    Guid InitiatorId,
    DateTime StartedAt,
    DateTime? CompletedAt
);

public record WorkflowInstanceDetailDto(
    Guid Id,
    Guid DefinitionId,
    string Title,
    InstanceStatus Status,
    Guid InitiatorId,
    DateTime StartedAt,
    DateTime? CompletedAt,
    List<WorkflowTokenDto> Tokens,
    List<WorkflowTaskDto> Tasks
);

public record WorkflowTokenDto(
    Guid Id,
    Guid NodeId,
    TokenStatus Status,
    DateTime ArrivedAt,
    DateTime? CompletedAt
);

public record WorkflowTaskDto(
    Guid Id,
    Guid InstanceId,
    Guid TokenId,
    Guid? AssigneeId,
    Domain.Enums.TaskStatus Status,
    DateTime? CompletedAt
);
