Skip to content

Commit

Permalink
#2979 - Email notification - PD/PPD Student reminder email 8 weeks be…
Browse files Browse the repository at this point in the history
…fore end date Hotfix (#3782)

Hot Fix for Application Status in Assessment.

- [X] Select all student applications where
  - Offerings end date within 8 weeks.
  - Applications with current disbursement pending.
  - Application not archived.
  - Remove assessments where a notification was already sent.
  - With the PD/PPD mismatch
  - Application Status is in Assessment and Completed

- [x] E2E Tests suite added, E2E tests will be added in Part 3 PR
  - [x] Ensure the email will be sent once for the same assessment.
- [x] Ensure the email will be sent again for different assessments for
the same application.
  • Loading branch information
bidyashish authored Oct 9, 2024
1 parent d228a55 commit 9272dcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe(

it(
"Should generate a notification for PD/PPD student mismatch close to the offering end date " +
"when the application is completed and at least one disbursement is pending and there is a PD/PPD mismatch.",
"when the application is Assessment/Completed and at least one disbursement is pending and there is a PD/PPD mismatch.",
async () => {
// Arrange
// Create a student with a non-approved disability.
Expand All @@ -64,7 +64,7 @@ describe(
db.dataSource,
{ student },
{
applicationStatus: ApplicationStatus.Completed,
applicationStatus: ApplicationStatus.Assessment,
currentAssessmentInitialValues: {
workflowData: {
calculatedData: {
Expand Down Expand Up @@ -123,7 +123,7 @@ describe(

it(
"Should not generate a notification for PD/PPD student mismatch close to the offering end date " +
"when the application is completed and email will be sent once for the same assessment.",
"when the application is Assessment/Completed and email will be sent once for the same assessment.",
async () => {
// Arrange
// Create a student with a non-approved disability.
Expand Down Expand Up @@ -197,7 +197,7 @@ describe(

it(
"Should generate a notification for PD/PPD student mismatch close to the offering end date " +
"when the application is completed and email will be sent again for different assessments for the same application.",
"when the application is Assessment/Completed and email will be sent again for different assessments for the same application.",
async () => {
// Arrange
// Create a student with a non-approved disability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,13 @@ export class ApplicationService {
.innerJoin("application.student", "student")
.innerJoin("student.user", "user")
.innerJoin("currentAssessment.offering", "offering")
.where("application.applicationStatus = :applicationStatus", {
applicationStatus: ApplicationStatus.Completed,
})
.where(
"application.applicationStatus IN (:applicationStatusCompleted, :applicationStatusAssessment)",
{
applicationStatusCompleted: ApplicationStatus.Completed,
applicationStatusAssessment: ApplicationStatus.Assessment,
},
)
.andWhere("offering.studyEndDate <= :disabilityNotificationDateLimit", {
disabilityNotificationDateLimit,
})
Expand Down

0 comments on commit 9272dcd

Please sign in to comment.