From cf36cb15547cf6762ec7ac498a567032b7d0e25d Mon Sep 17 00:00:00 2001 From: Kian Kwa Date: Fri, 3 May 2024 17:33:47 +0100 Subject: [PATCH] Added additional comments --- .../publication/services/service/NotificationService.java | 6 ++++++ .../services/service/UserNotificationService.java | 8 +++++++- .../emailgeneration/AdminWelcomeEmailGenerator.java | 3 +++ .../FlatFileSubscriptionEmailGenerator.java | 3 +++ .../InactiveUserNotificationEmailGenerator.java | 3 +++ .../LocationSubscriptionDeletionEmailGenerator.java | 3 +++ .../MediaAccountRejectionEmailGenerator.java | 3 +++ .../MediaApplicationReportingEmailGenerator.java | 3 +++ .../MediaDuplicatedAccountEmailGenerator.java | 3 +++ .../MediaUserVerificationEmailGenerator.java | 3 +++ .../emailgeneration/MediaWelcomeEmailGenerator.java | 3 +++ .../emailgeneration/MiDataReportingEmailGenerator.java | 3 +++ .../service/emailgeneration/OtpEmailGenerator.java | 3 +++ .../RawDataSubscriptionEmailGenerator.java | 3 +++ .../emailgeneration/SystemAdminUpdateEmailGenerator.java | 3 +++ .../emailgeneration/UnidentifiedBlobEmailGenerator.java | 3 +++ 16 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/NotificationService.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/NotificationService.java index 7f5e90fb3..9be01e0cb 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/NotificationService.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/NotificationService.java @@ -100,6 +100,12 @@ public String handleMiDataForReporting() { return emailService.sendEmail(email).getReference().orElse(null); } + /** + * This method handles the sending the email to all system admins for some actions on the application. + * + * @param body The body of the system admin update email. + * @return The ID that references the system admin update email. + */ public List sendSystemAdminUpdateEmailRequest(SystemAdminAction body) { List email = emailService.handleBatchEmailGeneration(new SystemAdminUpdateEmailData(body, envName), Templates.SYSTEM_ADMIN_UPDATE_EMAIL); diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/UserNotificationService.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/UserNotificationService.java index b87b56547..ec73bb46b 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/UserNotificationService.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/UserNotificationService.java @@ -59,7 +59,7 @@ public String mediaAccountWelcomeEmailRequest(WelcomeEmail body) { * Handles the incoming request for AAD welcome emails, checks the json payload and builds and sends the email. * * @param body JSONObject containing the email and forename/surname values e.g. - * email: 'example@email.com', forename: 'foo', surname: 'bar'} + * {email: 'example@email.com', forename: 'foo', surname: 'bar'} */ public String adminAccountWelcomeEmailRequest(CreatedAdminWelcomeEmail body) { log.info(writeLog(String.format("Admin account welcome email being processed for user %s", @@ -135,6 +135,12 @@ public String inactiveUserNotificationEmailRequest(InactiveUserNotificationEmail .orElse(null); } + /** + * Handles the sending of the email containing the OTP. + * + * @param body The body of the OTP email. + * @return The ID that references the OTP email. + */ public String handleOtpEmailRequest(OtpEmail body) { log.info(writeLog(String.format("OTP email being processed for user %s", EmailHelper.maskEmail(body.getEmail())))); diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/AdminWelcomeEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/AdminWelcomeEmailGenerator.java index b70397f68..71bb70e6a 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/AdminWelcomeEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/AdminWelcomeEmailGenerator.java @@ -12,6 +12,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.ADMIN_ACCOUNT_CREATION_EMAIL; @Service +/** + * Generate the admin welcome email with personalisation for GOV.UK Notify template. + */ public class AdminWelcomeEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/FlatFileSubscriptionEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/FlatFileSubscriptionEmailGenerator.java index c7c12ab03..78f2afd03 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/FlatFileSubscriptionEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/FlatFileSubscriptionEmailGenerator.java @@ -23,6 +23,9 @@ @Service @Slf4j @SuppressWarnings("PMD.PreserveStackTrace") +/** + * Generate the flat file subscription email with personalisation for GOV.UK Notify template. + */ public class FlatFileSubscriptionEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/InactiveUserNotificationEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/InactiveUserNotificationEmailGenerator.java index 0a5c97199..907517a13 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/InactiveUserNotificationEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/InactiveUserNotificationEmailGenerator.java @@ -15,6 +15,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.INACTIVE_USER_NOTIFICATION_EMAIL_CFT; @Service +/** + * Generate the inactive user notification email with personalisation for GOV.UK Notify template. + */ public class InactiveUserNotificationEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/LocationSubscriptionDeletionEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/LocationSubscriptionDeletionEmailGenerator.java index fb037303d..60389b1df 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/LocationSubscriptionDeletionEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/LocationSubscriptionDeletionEmailGenerator.java @@ -13,6 +13,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.DELETE_LOCATION_SUBSCRIPTION; @Service +/** + * Generate the location subscription email with personalisation for GOV.UK Notify template. + */ public class LocationSubscriptionDeletionEmailGenerator extends BatchEmailGenerator { @Override public List buildEmail(BatchEmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaAccountRejectionEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaAccountRejectionEmailGenerator.java index 47594a929..ec6f6cdda 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaAccountRejectionEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaAccountRejectionEmailGenerator.java @@ -14,6 +14,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.MEDIA_USER_REJECTION_EMAIL; @Service +/** + * Generate the media account rejection email with personalisation for GOV.UK Notify template. + */ public class MediaAccountRejectionEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaApplicationReportingEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaApplicationReportingEmailGenerator.java index cb6c16450..bb0dd4bf5 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaApplicationReportingEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaApplicationReportingEmailGenerator.java @@ -20,6 +20,9 @@ @Service @Slf4j @SuppressWarnings("PMD.PreserveStackTrace") +/** + * Generate the media application reporting email with personalisation for GOV.UK Notify template. + */ public class MediaApplicationReportingEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaDuplicatedAccountEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaDuplicatedAccountEmailGenerator.java index 347ba1c13..cd0c78eda 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaDuplicatedAccountEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaDuplicatedAccountEmailGenerator.java @@ -12,6 +12,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.MEDIA_DUPLICATE_ACCOUNT_EMAIL; @Service +/** + * Generate the media duplicated account email with personalisation for GOV.UK Notify template. + */ public class MediaDuplicatedAccountEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaUserVerificationEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaUserVerificationEmailGenerator.java index 1ffc64c71..004dc69fa 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaUserVerificationEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaUserVerificationEmailGenerator.java @@ -12,6 +12,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.MEDIA_USER_VERIFICATION_EMAIL; @Service +/** + * Generate the media user verification email with personalisation for GOV.UK Notify template. + */ public class MediaUserVerificationEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaWelcomeEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaWelcomeEmailGenerator.java index e59d6ca51..96263c8cd 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaWelcomeEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MediaWelcomeEmailGenerator.java @@ -14,6 +14,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.MEDIA_NEW_ACCOUNT_SETUP; @Service +/** + * Generate the media welcome email with personalisation for GOV.UK Notify template. + */ public class MediaWelcomeEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MiDataReportingEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MiDataReportingEmailGenerator.java index 166f2e0bc..1aba4008a 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MiDataReportingEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/MiDataReportingEmailGenerator.java @@ -20,6 +20,9 @@ @Service @Slf4j @SuppressWarnings("PMD.PreserveStackTrace") +/** + * Generate the MI data reporting email with personalisation for GOV.UK Notify template. + */ public class MiDataReportingEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/OtpEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/OtpEmailGenerator.java index 69aabda61..4cbd261a3 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/OtpEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/OtpEmailGenerator.java @@ -12,6 +12,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.OTP_EMAIL; @Service +/** + * Generate the OTP email with personalisation for GOV.UK Notify template. + */ public class OtpEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/RawDataSubscriptionEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/RawDataSubscriptionEmailGenerator.java index 6d61741c1..b7303ab2b 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/RawDataSubscriptionEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/RawDataSubscriptionEmailGenerator.java @@ -26,6 +26,9 @@ @Service @Slf4j @SuppressWarnings("PMD.PreserveStackTrace") +/** + * Generate the raw data subscription email with personalisation for GOV.UK Notify template. + */ public class RawDataSubscriptionEmailGenerator extends EmailGenerator { private static final String CASE_NUMBERS = "case_num"; private static final String DISPLAY_CASE_NUMBERS = "display_case_num"; diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/SystemAdminUpdateEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/SystemAdminUpdateEmailGenerator.java index 334cede81..a5e04fb31 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/SystemAdminUpdateEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/SystemAdminUpdateEmailGenerator.java @@ -15,6 +15,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.SYSTEM_ADMIN_UPDATE_EMAIL; @Service +/** + * Generate the system admin update email with personalisation for GOV.UK Notify template. + */ public class SystemAdminUpdateEmailGenerator extends BatchEmailGenerator { @Override public List buildEmail(BatchEmailData email, PersonalisationLinks personalisationLinks) { diff --git a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/UnidentifiedBlobEmailGenerator.java b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/UnidentifiedBlobEmailGenerator.java index cca4e318b..b28f6d2c3 100644 --- a/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/UnidentifiedBlobEmailGenerator.java +++ b/src/main/java/uk/gov/hmcts/reform/pip/publication/services/service/emailgeneration/UnidentifiedBlobEmailGenerator.java @@ -15,6 +15,9 @@ import static uk.gov.hmcts.reform.pip.publication.services.notify.Templates.BAD_BLOB_EMAIL; @Service +/** + * Generate the unidentified blob email with personalisation for GOV.UK Notify template. + */ public class UnidentifiedBlobEmailGenerator extends EmailGenerator { @Override public EmailToSend buildEmail(EmailData email, PersonalisationLinks personalisationLinks) {