Spaces:
Runtime error
Runtime error
Download src/SCM.Api/Controllers/ColetasController.cs from rafaeldavila/scm-api: direct link, hf CLI and curl.
- Browser
- Download file 4.31 kB
-
https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/src/SCM.Api/Controllers/ColetasController.cs
- Command line
-
hf download hf://spaces/rafaeldavila/scm-api/src/SCM.Api/Controllers/ColetasController.cs
-
curl -L -o ColetasController.cs https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/src/SCM.Api/Controllers/ColetasController.cs
4.31 kB
| using Asp.Versioning; | |
| using Microsoft.AspNetCore.Authorization; | |
| using Microsoft.AspNetCore.Mvc; | |
| using SCM.Application.Qualidade; | |
| using SCM.Shared.Api; | |
| using SCM.Shared.Constants; | |
| namespace SCM.Api.Controllers; | |
| /// <summary>Programação e coleta de inspeções (MCQ) — REST/JSON (substitui Palm/PDA/SOAP do legado).</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public sealed class ColetasController : ControllerBase | |
| { | |
| private readonly IColetaService _service; | |
| public ColetasController(IColetaService service) => _service = service; | |
| /// <summary>Programa (match) ou desprograma (unmatch) eventos para um agente — idempotente.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<ProgramarResponse>> Programar( | |
| Guid agenteId, [FromBody] ProgramarRequest request, CancellationToken ct = default) | |
| => Ok(await _service.ProgramarAsync(agenteId, request, ct)); | |
| /// <summary>Lista as programações de um agente.</summary> | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<IReadOnlyList<ProgramacaoResponse>>> GetProgramacoes( | |
| Guid agenteId, CancellationToken ct = default) | |
| => Ok(await _service.GetProgramacoesAsync(agenteId, ct)); | |
| /// <summary>Pacote de programação do agente (eventos + produção a liberar + campos de inspeção da fase).</summary> | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<PacoteProgramacaoResponse>> GetPacote( | |
| Guid agenteId, CancellationToken ct = default) | |
| => Ok(await _service.GetPacoteAsync(agenteId, ct)); | |
| /// <summary>Sincroniza a coleta (prévia valida sem persistir; efetivação processa evento a evento com log).</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<SincronizacaoResponse>> Sincronizar( | |
| [] SincronizarColetaRequest request, CancellationToken ct = default) | |
| => Ok(await _service.SincronizarAsync(request, ct)); | |
| /// <summary>Atualiza (substitui) os valores coletados de um evento — correção por planilha vira update (Frente B).</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<IActionResult> AtualizarValores( | |
| Guid eventoId, [FromBody] AtualizarValoresColetaRequest request, CancellationToken ct = default) | |
| { | |
| await _service.AtualizarValoresAsync(eventoId, request, ct); | |
| return NoContent(); | |
| } | |
| /// <summary>Logs de sincronização do agente (legado cl_logPDA).</summary> | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<IReadOnlyList<LogSincronizacaoResponse>>> GetLogs( | |
| Guid agenteId, CancellationToken ct = default) | |
| => Ok(await _service.GetLogsAsync(agenteId, ct)); | |
| } | |