-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Implementação do endpoint responsável por desabilitar o envio de e-mail #91
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
feat: Implementação do endpoint responsável por desabilitar o envio de e-mail #91
Conversation
…ble senders email
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 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
emailEnabledboolean field to the Reminder entity with getter/setter methods - Implemented conditional email sending in ReminderJob based on the
emailEnabledflag - Created two new service methods (
disableEmailandenableEmail) 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.
src/main/java/br/com/springnoobs/reminderapi/reminder/entity/Reminder.java
Outdated
Show resolved
Hide resolved
src/main/java/br/com/springnoobs/reminderapi/reminder/controller/ReminderController.java
Outdated
Show resolved
Hide resolved
src/main/java/br/com/springnoobs/reminderapi/reminder/controller/ReminderController.java
Outdated
Show resolved
Hide resolved
|
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 |
|
Corrigir o que o Copilot apontou |
|
Fazer envio somente do controller, o service será desenvolvido em outra issue |
|
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 |
|
Qualquer dúvida, falar comigo |
…tar o envio de e-mail
reminderRepository.findByIdWithAssociations(reminderId).ifPresent(reminder -> {
emailService.send(reminder);
if(Boolean.TRUE.equals(reminder.getEmailEnabled())) {
emailService.send(reminder);
} |
…ble senders email
…tar o envio de e-mail
Service layer merged in PR #96
…ithub.com:SpringNoobs/reminder-api into 76-Criar-endpoint-para-desabilitar-envio-de-email
Terminada a issue #76