Feature/eventos:Escrita - POST/PUT/DELETE - #542
Merged
Merged
Conversation
EduTiyo
requested changes
Sep 21, 2026
EduTiyo
left a comment
There was a problem hiding this comment.
Revisão em duas frentes (Standards e Spec) da escrita de Eventos. A transação do PUT do agregado (trocar tipo COLETA↔DIARIO apagando/criando eventos_coletas, upsert quando o tipo não muda) está correta e dentro de uma transação só, e o mapeamento CHECK→422 foi rastreado ponta a ponta e funciona. Peço mudança por um motivo concreto: dois testes de integração deixam dados vazarem se a asserção falhar, violando a regra do próprio test/integration/README.md. O resto são observações de manutenibilidade, não bloqueantes.
- extrai COLETA_FIELDS para Evento.ts e coleta-parsing.ts, eliminando a duplicação de CAMPOS_DA_FICHA - extrai AtualizarEventoValidator com a regra de coerência própria do update - alinha RemoverEventoController com o mesmo mapeamento de erro dos outros 2 controllers (404 para FK, 422 para CHECK) - corrige testes de integração sem try/finally em eventos-http.test.ts (cleanup vazava)
Author
|
EduTiyo
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Endpoints implementados:
Construção PUT:
Tratamento de erros:
Pontos marcados nos controllers para quando a autenticação for implementada.