-
Notifications
You must be signed in to change notification settings - Fork 14
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
#3054 - Email notification for blocked disbursement to ministry only once #4245
#3054 - Email notification for blocked disbursement to ministry only once #4245
Conversation
|
const notifications = [ | ||
this.ministryBlockedDisbursementNotification, | ||
this.studentBlockedDisbursementNotification, | ||
].map((notification) => | ||
notification.notify(eCertDisbursement, entityManager, log), |
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.
❤️ What a great way to segregate different notification services.
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.
LGTM👍Great way to segregate different notification services ❤️
* Provides a basic structure for creating and | ||
* sending notifications related to e-Cert disbursements. | ||
*/ | ||
export abstract class ECertNotification { |
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.
Great job! I love the way how the way how the e-cert based notifications are handled here with extensibility to add more notifications.
* Provides a basic structure for creating and | ||
* sending notifications related to e-Cert disbursements. | ||
*/ | ||
export abstract class ECertNotification { |
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.
One minor comment to mention. As this is a base class to create notifications, the student data is a core common part that can be built from a base class method. And that base class method can be called inside createNotification()
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.
The idea was that each notification could evolve differently and the data required for each should be handled in the inherited class. For instance, a notification for the Ministry could potentially contain further information about the blocked disbursement or something else. Assuming all notifications will have the student data as a core would not be accurate IMO.
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.
Excluding ministry emails for institutions, other ministry notifications have student first and last name as common. But not a blocker considering the present.
Amazing work @andrewsignori-aot. Just one comment. |
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.
Great Job! Looks good👍
ECertNotification
) and segregated the logic to generate blocked notifications intoMinistryBlockedDisbursementNotification
andStudentBlockedDisbursementNotification
.shouldCreateNotification
for the Students was moved and no changes were done for this PR, unless critical no comments will be addressed.ECertNotification
can be used for any other e-Cert notification as required, not only blocked disbursement.Please note that the student data required to generate the notification is now retrieved twice in the event that the disbursement is blocked and the Ministry should be notified for the first time. The benefit of having the separation between the logic for the different notifications seems greater than an occasional extra query to the student's table. Please note that the query was simplified from what it used to be.
Please also note that the below technical AC was not executed. The queries have different approaches, sometimes checking the existence, sometimes requiring a count, and sometimes requiring a count and a date last sent. I did not see a benefit for this PR. Please share an opinion/suggestion if needed.