Skip to content

Conversation

femelloffm
Copy link
Contributor

📍 Título

US04 - Criar endpoints para busca de UF e municipios brasileiros #81

📌 Descrição

  • Implementação de endpoints para buscar a lista de UFs brasileiras e a lista de municípios por UF, a partir da integração com uma API pública do IBGE. Estes endpoints serão necessários para os componentes de dropdown no frontend:

    image
  • Correção de erros de compilação na branch dev.

  • Implementação de testes unitários e correções de issues do Sonar em classes de teste.

🧪 Testes realizados:

Sucesso em busca de UFs:

image

Sucesso em busca de municípios:

image

Sigla de UF inválida:

image

Erro de autenticação:

image

✅ Checklist

  • Testes foram adicionados/atualizados
  • Documentação foi atualizada (se necessário) - sim, foi atualizada a doc do Swagger
  • O código segue os padrões do projeto

📎 Referências

#81

@femelloffm femelloffm added this to the Sprint 1 milestone Sep 6, 2025
@femelloffm femelloffm self-assigned this Sep 6, 2025
@femelloffm femelloffm requested a review from a team as a code owner September 6, 2025 19:26
@femelloffm femelloffm added the feature New feature or request label Sep 6, 2025
@femelloffm femelloffm linked an issue Sep 6, 2025 that may be closed by this pull request
@femelloffm femelloffm changed the title Feat/us04 81 Feat/us04-81: endpoints para busca de UF e municipios brasileiros Sep 6, 2025
@Glauber-Developer
Copy link
Contributor

@femelloffm boa noite, falta ajustar os conflitos para finalizar o PR.

@Copilot Copilot AI review requested due to automatic review settings September 8, 2025 00:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements endpoints for retrieving Brazilian states (UFs) and municipalities from the IBGE public API, creating necessary infrastructure for frontend dropdown components.

  • Adds new REST endpoints (/v1/states and /v1/states/{id}/cities) with JWT authentication
  • Integrates with IBGE API using RestTemplate with timeout configuration and error handling
  • Implements comprehensive unit tests for all new components and fixes compilation issues

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
StateController.java New REST controller with endpoints for states and cities retrieval
StateService.java Service layer handling business logic for state/city operations
IbgeClient.java HTTP client for IBGE API integration with timeout and error handling
RestTemplateConfig.java Configuration for RestTemplate with custom timeout settings
Various DTOs Data transfer objects for API requests/responses and IBGE integration
GlobalExceptionHandler.java Added handler for ClientTimeoutException
ClientTimeoutException.java New custom exception for API timeout scenarios
Test files Comprehensive unit tests for all new components and fixed import issues
Configuration files Added IBGE API URLs and security scheme documentation

Copy link
Contributor

@Glauber-Developer Glauber-Developer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bom dia @femelloffm, PR aprovado! Parabéns pela contribuição 🥇

# Conflicts:
#	pointtils/src/main/java/com/pointtils/pointtils/src/infrastructure/configs/GlobalExceptionHandler.java
#	pointtils/src/test/resources/application.properties
Copy link

sonarqubecloud bot commented Sep 8, 2025

@femelloffm femelloffm merged commit 08f4c8e into dev Sep 8, 2025
3 checks passed
GuilhermeOchoa pushed a commit that referenced this pull request Sep 22, 2025
Feat/us04-81: endpoints para busca de UF e municipios brasileiros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

US04 - Criar endpoints para busca de UF e municipios brasileiros

3 participants