Updated code for updating status on auto rejection after given time and updated cron.
This commit is contained in:
@@ -42,16 +42,12 @@ public class NotificationScheduler {
|
|||||||
|
|
||||||
if (amendmentRequest != null) {
|
if (amendmentRequest != null) {
|
||||||
LocalDateTime requestDate = amendmentRequest.getCreatedDate();
|
LocalDateTime requestDate = amendmentRequest.getCreatedDate();
|
||||||
|
|
||||||
// Eg :- Check if requestDate + 7 days is less than or equal to today
|
|
||||||
if (requestDate.plusDays(amendmentRequest.getResponseDays()).isAfter(today)) {
|
if (requestDate.plusDays(amendmentRequest.getResponseDays()).isAfter(today)) {
|
||||||
// Update the application status to REJECTED
|
// Update the application status to REJECTED
|
||||||
application.setStatus("REJECTED");
|
application.setStatus("REJECTED");
|
||||||
applicationRepository.save(application); // Save updated application
|
applicationRepository.save(application);
|
||||||
|
amendmentRequest.setStatus("CLOSE");
|
||||||
// Update the amendment request status to CLOSED
|
applicationAmendmentRepository.save(amendmentRequest);
|
||||||
// amendmentRequest.setStatus("CLOSE");
|
|
||||||
// applicationAmendmentRepository.save(amendmentRequest); // Save updated amendment request
|
|
||||||
emailNotificationDao.sendApplicationFailureNotificationEmail(amendmentRequest);
|
emailNotificationDao.sendApplicationFailureNotificationEmail(amendmentRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user