Skip to content

Feature/pet editing#98

Open
rafaelnmelo wants to merge 4 commits intodevelopfrom
feature/pet-editing
Open

Feature/pet editing#98
rafaelnmelo wants to merge 4 commits intodevelopfrom
feature/pet-editing

Conversation

@rafaelnmelo
Copy link
Contributor

@rafaelnmelo rafaelnmelo commented Nov 3, 2025

🐾 Integração de API para edição de pet cadastrado

📌 Descrição
Integração dos serviços de edição dos pets já cadastrados

Alterações Principais

  • Adição de parâmetro para lidar com a edição de pet em PetRegisterViewModel
  • Tratamento em PetRegisterAlert para novo caso de edição de pet
  • Remoção de valores estáticos no PetRegisterViewModel
  • Preenchimento da PetRegisterView com pet cadastrado
  • Novos endpoints em URLManager
  • Nova struct para a nova requisição de edição em PetService
  • PetDataCache: sistema de cache para raças e tamanhos de pets
  • Adição de novos métodos em PetRegisterService para edição de pet, busca de raças e tamanhos
  • Tratamento dos novos dados em PetRegisterViewModel

Melhorias e refatorações

  • Nova extensão para exibição personalizada de data em Extension+String
  • Busca automática da aba na nevagação em NavigationRouter
  • Adição de parâmetro opcional para navegação à PetRegister
  • Refatoração devida às mudanças de navegação: PetListView, PetProfileView, CustomNavigationBar

📊 Como Testar

  • Acessar a aba de pets PetListView onde a listagem é exibida
  • Selecionar um pet existente e clicar no botão de edição da PetProfileView
  • Efetuar modificações no pet e clicar em salvar

Critérios de Aceite

  • O fluxo de edição de pet está funcional

- Add PUT endpoint support for pet updates in PetRegisterService
- Add DELETE endpoint for pet removal with confirmation dialog
- Implement pet edit mode in PetRegisterView with proper navigation
- Add toBrazilianDateFormat() method to convert API dates to Brazilian format
- Update URLManager with computed property for pet update endpoints
- Refactor PetRegisterViewModel to handle both create and edit modes
- Fix navigation flow to properly pass pet data between views
- Add delete confirmation alert with primary/secondary button support
- Improve date formatting consistency between API and UI display
- Extract common form data creation logic to reduce code duplication
- Add PetUpdateRequest struct as Codable model for JSON requests
- Create createJSONBody method to convert PetModel to PetUpdateRequest
- Update pet update method to use NetworkManager.jsonRequest instead of multipartRequest
- Maintain existing createFormData method for register operation compatibility
- Adjust on PetRegisterModel static values
@rafaelnmelo rafaelnmelo self-assigned this Nov 3, 2025
@rafaelnmelo rafaelnmelo requested a review from rafaseron November 3, 2025 13:24
- Add PetDataCache for local storage of dog/cat breeds and sizes
- Add new API endpoints for breeds in URLManager (breedsByCat, breedsByDog)
- Add new API endpoints for sizes in URLManager (sizesByCat, sizesByDog)
- Refactor PetRegisterService with improved error handling and breed fetching
- Refactor PetRegisterViewModel with better organization and MARK comments
- Update PetRegisterView to remove sample image loading task
- Update project configuration to include new PetDataCache file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant