Listagens públicas devem exibir apenas produtos e categorias ativos
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java, spring-boot
- Domain
- backend-api-design, databases, testing
Research direction
Start with ProductRepository.java and CategoryService.java to trace the public listings, then read ProductService.java and the linked ResourceServerConfig.java for ID lookups and access rules. Decide the behavior for inactive items, roles, and products in inactive categories, then cover those decisions with integration tests. Update API-ENDPOINTS.md and DATA-ACCESS.md; done means the documented rules and acceptance criteria are tested.
Written by the indexing model from the issue text.
Description
Contexto
Produtos e categorias têm o indicador active, mas as entidades só armazenam o valor, sem aplicar nenhuma regra com base nele (DOMAIN-MODEL.md).
As rotas GET /api/v1/products/** e GET /api/v1/categories/** são públicas (ResourceServerConfig.java:81), e nenhuma consulta filtra pelo active:
- a listagem de produtos usa
searchProducts, sem condição sobreactive(ProductRepository.java:116-131); - a listagem de categorias usa
findByNameContainingIgnoreCaseoufindAll(CategoryService.java:97-99); - a busca por id também devolve itens inativos (ProductService.java:180-183, CategoryService.java:115-118).
Por isso, um produto ou uma categoria desativados por PATCH /{id}/deactivate continuam aparecendo para o frontend.
O que fazer
- Filtrar por
active = truenas listagens públicas de produtos e de categorias. - Decidir e documentar:
- se ADMIN e OPERATOR continuam vendo os itens inativos (por exemplo, por um parâmetro ou por uma rota de gestão);
- o que o
GET /{id}público responde para um item inativo; - se um produto ativo que só pertence a categorias inativas deve aparecer.
Critérios de aceite
-
GET /api/v1/productssem token não devolve produtos inativos, inclusive com os filtrosnameecategoryIds. -
GET /api/v1/categoriessem token não devolve categorias inativas. - O comportamento do
GET /{id}para itens inativos está definido e coberto por teste. - A forma como ADMIN e OPERATOR acessam os itens inativos está definida e testada.
- Testes de integração cobrindo as listagens com itens ativos e inativos.
- API-ENDPOINTS.md e DATA-ACCESS.md atualizados.
- Dominant language
- Java
- Stars
- 1
- Forks
- 1
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Albertinesilva/backend-engineering-journey-java-springboot
-
enhancement frontend
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Albertinesilva/backend-engineering-journey-java-springboot#46 ·
-
enhancement tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Albertinesilva/backend-engineering-journey-java-springboot#41 ·
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Albertinesilva/backend-engineering-journey-java-springboot#34 ·
-
frontend production-readiness security
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Albertinesilva/backend-engineering-journey-java-springboot#18 · 1 comment ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Albertinesilva/backend-engineering-journey-java-springboot#7 ·
All issues in Albertinesilva/backend-engineering-journey-java-springboot
Similar issues
-
[Bug] 资源包列表 与 模组/数据包/世界 列表排列顺序不一致Possibly taken @fishdry1000 claimed this 4 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
AtlasOfLivingAustralia/species-lists#882 ·
Maintainers usually reply within 1 day
-
Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ballerina-platform/ballerina-library#9458 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
winder/Universal-G-Code-Sender#3242 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PCL-Community/PCL-CE#3767 ·
Maintainers usually reply within 1 day