feat(categoria-proxy): Card 03 — 4 endpoints de categoria (proxy + guards) - #502
Merged
FernandoAlmeidaPinto merged 2 commits intoJul 26, 2026
Merged
Conversation
…tById/create/delete) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s alterarPermissao Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Closes #501
Etapa 3 (CRUD Categoria) — Card 03. Expõe no gateway os 4 endpoints de categoria fazendo proxy pro ms-simulado.
Summary
CategoriaProxyService(novo, padrãoFrenteProxyService):getAll(page,limit),getById(id),create(dto),delete(id)→v1/categoria*no ms-simulado.CategoriaProxyController(estendido — já existia com só@Get()): agora 4 endpoints:GET /mssimulado/categoria(paginado) eGET /:id—@UseGuards(JwtAuthGuard).POSTeDELETE /:id—@UseGuards(JwtAuthGuard, PermissionsGuard)+alterarPermissao.CreateCategoriaDtoInput(nome?, prefixo?, duracao, quantidadeTotalQuestao?, exame, descricao?).CategoriaProxyServiceregistrado noSimuladoModule.Decisões / correções vs card
CategoriaProxyControllerjá existia (desde a etapa 1, com@Get() getCategorias()). Migrei o@Get()para paginado +JwtAuthGuard. Seguro: o client já enviaBearer token+?page&limite espera o envelope paginado do ms-simulado.JwtAuthGuard, PermissionsGuard(não sóPermissionsGuardcomo o Frente): oPermissionsGuardretorna 403 quando falta token, mas o critério exige 401. ComJwtAuthGuardprimeiro: sem token → 401; token sem permissão → 403.HttpServiceAxios(re-throw comoHttpExceptioncom o status upstream).PATCH. Nenhuma rota/tipos(confirmado inexistente).Test Plan
CategoriaProxyService(URLs encaminhadas) — passam;buildlimpoalterarPermissao→ 403; POST admin → cria; DELETE em uso → 409{simuladosUsando}; GET lista sem soft-deletedFollow-up (não-bloqueante)
SimuladoService.getCategorias()fica órfão após a migração do controller — remover em cleanup.custom/selecionavelpropositalmente fora do DTO (backend força;whitelistdescarta se enviados).🤖 Generated with Claude Code