Spaces:
Runtime error
Runtime error
File size: 969 Bytes
de8b914 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SCM.Application.Consultas;
using SCM.Shared.Api;
namespace SCM.Api.Controllers;
/// <summary>Dashboard operacional da obra (produção/CQ/medição/recálculo) — read-model agregado.</summary>
[ApiController]
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}")]
[Authorize]
[Produces("application/json")]
public sealed class DashboardController : ControllerBase
{
private readonly IDashboardService _service;
public DashboardController(IDashboardService service) => _service = service;
[HttpGet("obras/{obraId:guid}/dashboard")]
[ProducesResponseType(typeof(DashboardResponse), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ApiResponse), StatusCodes.Status404NotFound)]
public async Task<ActionResult<DashboardResponse>> Get(Guid obraId, CancellationToken ct = default)
=> Ok(await _service.GetAsync(obraId, ct));
}
|