diff --git a/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/student-application-notifications/_tests_/student-application-notifications.scheduler.e2e-spec.ts b/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/student-application-notifications/_tests_/student-application-notifications.scheduler.e2e-spec.ts index f5e7395b31..c41f327438 100644 --- a/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/student-application-notifications/_tests_/student-application-notifications.scheduler.e2e-spec.ts +++ b/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/student-application-notifications/_tests_/student-application-notifications.scheduler.e2e-spec.ts @@ -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. @@ -64,7 +64,7 @@ describe( db.dataSource, { student }, { - applicationStatus: ApplicationStatus.Completed, + applicationStatus: ApplicationStatus.Assessment, currentAssessmentInitialValues: { workflowData: { calculatedData: { @@ -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. @@ -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. diff --git a/sources/packages/backend/apps/queue-consumers/src/services/application/application.service.ts b/sources/packages/backend/apps/queue-consumers/src/services/application/application.service.ts index 0e53c158ed..12f48b9bc5 100644 --- a/sources/packages/backend/apps/queue-consumers/src/services/application/application.service.ts +++ b/sources/packages/backend/apps/queue-consumers/src/services/application/application.service.ts @@ -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, })