scm-api / src /SCM.Api /Controllers /FaturamentosController.cs
rafaeldavila's picture
Deploy SCM API (.NET 8) - Docker Space
de8b914 verified
Raw History Blame Contribute Delete
1.25 kB
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SCM.Application.Medicao;
using SCM.Shared.Api;
using SCM.Shared.Constants;
namespace SCM.Api.Controllers;
/// <summary>Faturamento físico-financeiro por EAP (read-model JSON; tipos F/P/J; PDF adiado).</summary>
[ApiController]
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}")]
[Authorize]
[Produces("application/json")]
public sealed class FaturamentosController : ControllerBase
{
private readonly IFaturamentoService _service;
public FaturamentosController(IFaturamentoService service) => _service = service;
/// <summary>Relatório de faturamento do contrato: valor previsto e apropriado por EAP×item.</summary>
[HttpGet("contratos/{contratoId:guid}/faturamento")]
[Authorize(Roles = Roles.Administrador + "," + Roles.Gestor + "," + Roles.Engenheiro)]
[ProducesResponseType(typeof(FaturamentoResponse), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ApiResponse), StatusCodes.Status404NotFound)]
public async Task<ActionResult<FaturamentoResponse>> GetFaturamento(
Guid contratoId, CancellationToken ct = default)
=> Ok(await _service.GetFaturamentoAsync(contratoId, ct));
}