feat(categoria): Card 02 — create restrito (força custom, auto-nome, 409/400) - #156
Merged
FernandoAlmeidaPinto merged 2 commits intoJul 26, 2026
Conversation
FernandoAlmeidaPinto
deleted the
feature/crud-categoria-card-02-create-restrictions
branch
July 26, 2026 07:13
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 #154
Etapa 3 (CRUD Categoria) — Card 02. Restringe a criação de categorias via
POST /v1/categoriaa apenas personalizadas.Summary
CategoriaService.add(método real, chamado pelo controllerPOST):dto.nomeou auto-gera deprefixo + qtd + duração(gerarNomeAuto)."Enem Dia 1") não seguem o pattern custom; com a ordem inversa dariam 400 em vez do 409 esperado.validarPatternNome→ 400).custom: true+selecionavel: trueviaObject.assign(override por último) — backend é fonte de verdade, ignora o DTO.CreateCategoriaDTOInput:nomeagora opcional, novoprefixo?, e o@CategoriaUniquefoi removido (unicidade migrou pro service → 409, decisão aprovada).gerarNomeAutonormaliza whitespace interno do prefixo (onometem índice unique — evita"Mini X"≠"Mini X").Decisões
PATCH/update de categoria.Test Plan
add+ 4 dedelete(Card 01) intactos → 14/14 passamnpm run buildlimpoPOST {quantidadeTotalQuestao:30,duracao:60}→"Personalizado 30q 60min";{nome:'Enem Dia 1'}→ 409;{nome:'x'}→ 400Follow-up (minor, não-bloqueante)
CategoriaUniqueValidatorfica registrado no módulo sem uso após sair do DTO.🤖 Generated with Claude Code