using DigitalData.TaskFlow.API.Contracts.Workflows;
using DigitalData.TaskFlow.Application.Features.Workflows.Commands.CloseWorkflow;
using DigitalData.TaskFlow.Application.Features.Workflows.Queries.GetWorkflows;
using DigitalData.TaskFlow.Domain.Closing;
using DigitalData.TaskFlow.Domain.Common;
using DigitalData.TaskFlow.Domain.Workflows;
using MediatR;
using Microsoft.AspNetCore.Mvc;
namespace DigitalData.TaskFlow.API.Controllers;
///
/// Provides workflow read and close endpoints.
///
[ApiController]
[Route("api/workflows")]
public sealed class WorkflowsController(ISender sender) : ControllerBase
{
///
/// Returns open workflows for a WISAG user identifier.
///
/// WISAG user identifier.
/// Cancellation token.
/// Workflow response envelope grouped by source.
[HttpGet("{wisagId:int}")]
[ProducesResponseType(typeof(ApiEnvelope), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ApiEnvelope