Spaces:
Runtime error
Runtime error
Download src/SCM.Api/Controllers/FatoresProdutividadeController.cs from rafaeldavila/scm-api: direct link, hf CLI and curl.
- Browser
- Download file 5.65 kB
-
https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/src/SCM.Api/Controllers/FatoresProdutividadeController.cs
- Command line
-
hf download hf://spaces/rafaeldavila/scm-api/src/SCM.Api/Controllers/FatoresProdutividadeController.cs
-
curl -L -o FatoresProdutividadeController.cs https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/src/SCM.Api/Controllers/FatoresProdutividadeController.cs
5.65 kB
| using Asp.Versioning; | |
| using Microsoft.AspNetCore.Authorization; | |
| using Microsoft.AspNetCore.Mvc; | |
| using SCM.Application.Controle; | |
| using SCM.Shared.Api; | |
| using SCM.Shared.Constants; | |
| namespace SCM.Api.Controllers; | |
| /// <summary>Fatores de produtividade (MBC) — HH/unidade por sub-atividade, associação e apuração.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public sealed class FatoresProdutividadeController : ControllerBase | |
| { | |
| private readonly IFatorProdutividadeService _service; | |
| public FatoresProdutividadeController(IFatorProdutividadeService service) => _service = service; | |
| /// <summary>Lista os fatores de produtividade de uma obra.</summary> | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<IReadOnlyList<FatorResponse>>> GetByObra(Guid obraId, CancellationToken ct = default) | |
| => Ok(await _service.GetByObraAsync(obraId, ct)); | |
| /// <summary>Cria um fator de produtividade (código único por obra).</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<FatorResponse>> Create([FromBody] CreateFatorRequest request, CancellationToken ct = default) | |
| => Ok(await _service.CreateAsync(request, ct)); | |
| /// <summary>Atualiza código/descrição/metas de um fator.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<FatorResponse>> Update(Guid id, [FromBody] UpdateFatorRequest request, CancellationToken ct = default) | |
| => Ok(await _service.UpdateAsync(id, request, ct)); | |
| /// <summary>Exclui um fator sem itens associados.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<IActionResult> Delete(Guid id, CancellationToken ct = default) | |
| { | |
| await _service.DeleteAsync(id, ct); | |
| return NoContent(); | |
| } | |
| /// <summary>Detalhes do fator (operadores sobre características do IC).</summary> | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<IReadOnlyList<FatorDetalheResponse>>> GetDetalhes(Guid id, CancellationToken ct = default) | |
| => Ok(await _service.GetDetalhesAsync(id, ct)); | |
| /// <summary>Define (substitui) os detalhes do fator — dirigem a escolha na associação.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<IReadOnlyList<FatorDetalheResponse>>> DefinirDetalhes( | |
| Guid id, [FromBody] DefinirDetalhesRequest request, CancellationToken ct = default) | |
| => Ok(await _service.DefinirDetalhesAsync(id, request, ct)); | |
| /// <summary>Associa o fator (pela sub-atividade do item) e calcula o hhPrev. Sem fator casado limpa.</summary> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<AssociacaoFatorResponse>> Associar( | |
| Guid itemProgramadoId, [FromBody] AssociarFatorRequest request, CancellationToken ct = default) | |
| => Ok(await _service.AssociarAsync(itemProgramadoId, request, ct)); | |
| /// <summary>Histórico de produtividade dia×equipe apurado para a FT (após finalizar).</summary> | |
| [] | |
| [] | |
| [] | |
| public async Task<ActionResult<ApuracaoFtResponse>> GetApuracao(Guid folhaTarefaId, CancellationToken ct = default) | |
| => Ok(await _service.GetApuracaoAsync(folhaTarefaId, ct)); | |
| } | |