Skip to content

Conversation

femelloffm
Copy link
Contributor

@femelloffm femelloffm commented Oct 5, 2025

📍 Título

Corrige filtro de interprete por data e horario disponivel para verificar se existem agendamentos no horário

📌 Descrição

Corrige filtro de intérprete por data e horário disponível para verificar se existem agendamentos no horário. Serão retornados apenas os intérpretes que atenderem no horário informado (de acordo com tabela Schedule) e que, além disso, não tenham um agendamento já confirmado para o horário informado (de acordo com tabela Appointment).

🛠️ O que foi feito?

  • Implementação de nova funcionalidade
  • Correção de bug
  • Refatoração de código
  • Atualização de documentação

🔍 Arquivos novos/modificados?

path: pointtils/src/main/java/com/pointtils/pointtils/src/application/services/InterpreterService.java
path: pointtils/src/main/java/com/pointtils/pointtils/src/infrastructure/repositories/spec/InterpreterSpecification.java
path: pointtils/src/test/java/com/pointtils/pointtils/src/infrastructure/repositories/spec/InterpreterSpecificationIntegrationTest.java

🧪 Testes realizados:

Valores no banco de dados:
image
image

Resultados do filtro - sem schedule para aquele horário:
image

Resultados do filtro - tem schedule para aquele horário e é antes de agendamento:
image

Resultados do filtro - tem schedule para aquele horário e é depois de agendamento:
image

Resultados do filtro - tem schedule para aquele horário mas horário informado iniciaria durante um agendamento:
image

Resultados do filtro - tem schedule para aquele horário mas horário informado encerraria durante um agendamento:
image

👀 Problemas conhecidos:

Ao executar os testes locais, está tudo funcionando corretamente!
No entanto, na pipeline do GitHub, está falhando.

✅ Checklist

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

📎 Referências

#129

@femelloffm femelloffm added this to the Sprint 3 milestone Oct 5, 2025
@femelloffm femelloffm self-assigned this Oct 5, 2025
@femelloffm femelloffm added the bugfix Something isn't working label Oct 5, 2025
@femelloffm femelloffm linked an issue Oct 5, 2025 that may be closed by this pull request
@femelloffm femelloffm marked this pull request as ready for review October 5, 2025 23:58
@femelloffm femelloffm requested a review from a team as a code owner October 5, 2025 23:58
@Copilot Copilot AI review requested due to automatic review settings October 5, 2025 23:58
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 fixes the interpreter filtering by date and time to properly verify if there are conflicting appointments during the requested time slot. The filtering now returns only interpreters who have a schedule for the requested time (according to the Schedule table) and don't have any confirmed appointments during that time (according to the Appointment table).

  • Refactored the InterpreterSpecification to properly validate appointment conflicts
  • Simplified the InterpreterService to consolidate date/time handling
  • Added comprehensive integration tests using Testcontainers with PostgreSQL

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
InterpreterSpecification.java Completely refactored filtering logic to properly check appointment conflicts with new subquery approach
InterpreterService.java Simplified date/time parameter handling by consolidating into a single LocalDateTime parameter
InterpreterSpecificationIntegrationTest.java Added comprehensive integration tests using Testcontainers to validate filtering behavior
InterpreterSpecificationTest.java Removed unit tests (replaced by integration tests)
application-testcontainers.properties Added Testcontainers configuration for PostgreSQL-based integration tests
pom.xml Added Testcontainers dependencies for PostgreSQL integration testing

Copy link

sonarqubecloud bot commented Oct 9, 2025

@femelloffm femelloffm merged commit 6c26a58 into dev Oct 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Corrigir filtro por data disponível em GET /v1/interpreters

1 participant