Skip to content
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

#3594 - Email to Student - 2nd Disbursement has passed, still pending (Part 3) #4310

Conversation

lewischen-aot
Copy link
Collaborator

@lewischen-aot lewischen-aot commented Jan 31, 2025

As the final part of the story, this PR has the following changes:

  • Added E2E tests for the second disbursement reminder notification.
    • Should generate a second disbursement reminder notification for a student when the application is Completed and the second disbursement with Required COE status is still pending when its disbursement date has passed.
    • Should not generate a second disbursement reminder notification for a student when a notification is already sent for the second disbursement still pending.
    • Should not generate a second disbursement reminder notification for a student when an application has two disbursements with both COEs completed but the second disbursement is still pending.

image

@lewischen-aot lewischen-aot self-assigned this Jan 31, 2025
@lewischen-aot lewischen-aot marked this pull request as ready for review January 31, 2025 22:36
Comment on lines 394 to 398
notificationMessage: await db.notificationMessage.findOne({
where: {
id: NotificationMessageType.StudentSecondDisbursementNotification,
},
}),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is no need to execute the db.notificationMessage.findOne to get the notification from DB since its ID is known. Can you please try the below?

const notification = createFakeNotification(
  {
    user: student.user,
    notificationMessage: {  id: NotificationMessageType.StudentSecondDisbursementNotification } as NotificationMessage,
  },
  {
    initialValue: {
      metadata: { assessmentId: application.currentAssessment.id },
    },
  },
);

"when a notification is already sent for the second disbursement still pending.",
async () => {
// Arrange
const student = await saveFakeStudent(db.dataSource);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, but the student creation will be executed by the saveFakeApplicationDisbursements in case one student is not provided.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nic work, just a minor comment.
If possible, it would be good to have a scenario where we have two COEs approved with a pending disbursement.

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.4% ( 3896 / 17396 )
Methods: 10.26% ( 226 / 2203 )
Lines: 25.75% ( 3362 / 13056 )
Branches: 14.41% ( 308 / 2137 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.59% ( 589 / 898 )
Methods: 59.63% ( 65 / 109 )
Lines: 68.72% ( 468 / 681 )
Branches: 51.85% ( 56 / 108 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 87.15% ( 1404 / 1611 )
Methods: 84.66% ( 160 / 189 )
Lines: 89.38% ( 1161 / 1299 )
Branches: 67.48% ( 83 / 123 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 68.11% ( 6040 / 8868 )
Methods: 65.72% ( 744 / 1132 )
Lines: 71.97% ( 4731 / 6574 )
Branches: 48.62% ( 565 / 1162 )

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the extra E2E, nice work, looks good 👍

Copy link
Collaborator

@bidyashish bidyashish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lewischen-aot lewischen-aot added this pull request to the merge queue Feb 1, 2025
Merged via the queue into main with commit ef8da31 Feb 1, 2025
21 checks passed
@lewischen-aot lewischen-aot deleted the feature/#3594-email-to-student-2nd-disbursement-has-passed-part-3 branch February 1, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants