Skip to content

Conversation

@vitinh0z
Copy link
Contributor

Terminada a issue #76

Copilot AI review requested due to automatic review settings December 10, 2025 19:35
Copy link
Contributor

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 functionality to enable or disable email sending for individual reminders, completing issue #76. The implementation adds a new emailEnabled field to the Reminder entity with a default value of true, updates the reminder job to check this flag before sending emails, and exposes two new PATCH endpoints to toggle the email sending behavior.

Key Changes:

  • Added emailEnabled boolean field to the Reminder entity with getter/setter methods
  • Implemented conditional email sending in ReminderJob based on the emailEnabled flag
  • Created two new service methods (disableEmail and enableEmail) and corresponding REST endpoints

Reviewed changes

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

Show a summary per file
File Description
src/main/java/br/com/springnoobs/reminderapi/reminder/entity/Reminder.java Added emailEnabled field with default value true and updated constructor to include this parameter
src/main/java/br/com/springnoobs/reminderapi/schedule/job/reminder/ReminderJob.java Added conditional check to only send emails when emailEnabled is true
src/main/java/br/com/springnoobs/reminderapi/reminder/service/ReminderService.java Implemented disableEmail and enableEmail methods to toggle email sending per reminder
src/main/java/br/com/springnoobs/reminderapi/reminder/controller/ReminderController.java Added two PATCH endpoints (/{id}/disable-email and /{id}/enable-email) to expose the email toggle functionality
pom.xml Changed H2 database scope from test to runtime

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lucasbdourado
Copy link
Contributor

lucasbdourado commented Dec 10, 2025

Alterar o título do commit para manter o padrão já utilizado, sendo fix: para ajustes ou correções, e feat: para novas funcionalidades e códigos adicionados

Exemplo: feat: Implementação do endpoint responsável por habilitar ou desabilitar o envio de e-mail

@lucasbdourado
Copy link
Contributor

Corrigir o que o Copilot apontou

@lucasbdourado
Copy link
Contributor

Fazer envio somente do controller, o service será desenvolvido em outra issue

@lucasbdourado
Copy link
Contributor

lucasbdourado commented Dec 10, 2025

Não será necessario a flag de controle de envio de e-mail na entidade nesse momento, tendo em vista que só sera desabilitado, não será habilitado novamente

@lucasbdourado
Copy link
Contributor

Qualquer dúvida, falar comigo

@JoaoVictorGI
Copy link
Contributor

JoaoVictorGI commented Dec 10, 2025

  • Formatar o código corretamente (Rodando ./mvnw clean install -DskipTests);
  • Manter o H2 apenas para ambiente de teste;
  • Adicionar os novos endpoints na documentação;
  • Um if(reminder.getEmailEnabled()) não funcionaria? Verificar se Boolean.TRUE.equals() é necessário:
reminderRepository.findByIdWithAssociations(reminderId).ifPresent(reminder -> {
  emailService.send(reminder);
   if(Boolean.TRUE.equals(reminder.getEmailEnabled())) {
     emailService.send(reminder);
   }

@vitinh0z vitinh0z changed the title finish: implementation of the endpoint responsible for enable or disabiling email sender feat: Implementação do endpoint responsável por habilitar ou desabilitar o envio de e-mail Dec 10, 2025
@vitinh0z vitinh0z changed the title feat: Implementação do endpoint responsável por habilitar ou desabilitar o envio de e-mail feat: Implementação do endpoint responsável por desabilitar o envio de e-mail Dec 14, 2025
@SpringNoobs SpringNoobs deleted a comment from Copilot AI Dec 16, 2025
@SpringNoobs SpringNoobs deleted a comment from Copilot AI Dec 16, 2025
@SpringNoobs SpringNoobs deleted a comment from Copilot AI Dec 16, 2025
@SpringNoobs SpringNoobs deleted a comment from Copilot AI Dec 16, 2025
@lucasbdourado lucasbdourado requested review from lucasbdourado and removed request for JoaoVictorGI December 18, 2025 19:37
@lucasbdourado lucasbdourado merged commit 8784a07 into master Dec 18, 2025
2 checks passed
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.

4 participants