-
Notifications
You must be signed in to change notification settings - Fork 0
Corrige filtro de interprete por data e horario disponivel #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…icar agendamentos
There was a problem hiding this 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 |
...a/com/pointtils/pointtils/src/infrastructure/repositories/spec/InterpreterSpecification.java
Show resolved
Hide resolved
...a/com/pointtils/pointtils/src/infrastructure/repositories/spec/InterpreterSpecification.java
Show resolved
Hide resolved
...a/com/pointtils/pointtils/src/infrastructure/repositories/spec/InterpreterSpecification.java
Show resolved
Hide resolved
…ades do testcontainers via TestPropertySource
|
📍 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?
🔍 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:


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

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

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

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

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

👀 Problemas conhecidos:
Ao executar os testes locais, está tudo funcionando corretamente!
No entanto, na pipeline do GitHub, está falhando.
✅ Checklist
📎 Referências
#129