Commit fd80213d authored by Pratik Shrivastava's avatar Pratik Shrivastava

feat: add method to update special admission date and time

parent e743b7da
...@@ -202,6 +202,40 @@ public class AdmissionFormDAOController { ...@@ -202,6 +202,40 @@ public class AdmissionFormDAOController {
return updated; return updated;
} }
public boolean updateSpecialAdmissionDateTime(
Long id,
String interactionDate,
String interactionTime
) throws Exception {
boolean updated = admissionFormDataRepository
.updateAdmissionDateTime(id, interactionDate, interactionTime);
if (updated) {
AdmissionFormData data = this.admissionFormDataRepository.getAdmissionFormDataById(id);
String emailBody = this.templateService
.generateSpecialAdmissionConfirmationFormTemplate(data);
ByteArrayInputStream pdfStream = pdfService.convertHtmlToPdf(emailBody);
String[] bcc = BCC_LM_BOYS;
if (!data.getSchool().equals("La Martiniere for Boys")) {
bcc = BCC_LM_GIRLS;
}
this.emailService.sendHtmlEmail(
data.getFatherEmail(),
bcc,
"ADMISSION APPOINTMENT | " + data.getSchool().toUpperCase(),
emailBody,
pdfStream
);
}
return updated;
}
public AdmissionFormCount getAdmissionFormCount() { public AdmissionFormCount getAdmissionFormCount() {
return admissionFormDataRepository.getAdmissionFormCount(); return admissionFormDataRepository.getAdmissionFormCount();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment