Reminder mail to beneficiary

This commit is contained in:
harish
2024-10-31 14:16:26 +05:30
parent 7f0f447c8c
commit c0bd9bb928
11 changed files with 162 additions and 3 deletions

View File

@@ -171,4 +171,19 @@ public interface ApplicationAmendmentRequestApi {
@Parameter(description = "The application amendment id", required = true) @PathVariable("applicationAmendmentId") Long applicationAmendmentId,
@Parameter(description = "status", required = true)@RequestParam(value = "status", required = true) ApplicationAmendmentRequestEnum status);
@Operation(summary = "Send reminder email for the specified amendment",
responses = {
@ApiResponse(responseCode = "200", description = "Email sent successfully"),
@ApiResponse(responseCode = "404", description = "Amendment not found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) }))
})
@PostMapping(value = "sendReminderEmail/{amendmentId}", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<Response<Void>> sendReminderEmail(HttpServletRequest request,
@Parameter( required = true)
@PathVariable(value = "amendmentId") Long amendmentId);
}

View File

@@ -117,4 +117,16 @@ public class ApplicationAmendmentRequestController implements ApplicationAmendme
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(applicationResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.APPLICATION_STATUS_UPDATED_SUCCESSFULLY)));
}
@Override
public ResponseEntity<Response<Void>> sendReminderEmail(
HttpServletRequest request,
Long amendmentId) {
log.info("Sending reminder email for Amendment ID: {}", amendmentId);
applicationAmendmentRequestService.sendReminderEmail(request,amendmentId);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.REMINDER_EMAIL_SENT_SUCCESS_MSG)));
}
}