diff --git a/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/sfas-integration/_tests_/sfas-files/SFAS-TO-SIMS-2024MAR21-PT-APPLICATION-DATA-IMPORT.txt b/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/sfas-integration/_tests_/sfas-files/SFAS-TO-SIMS-2024MAR21-PT-APPLICATION-DATA-IMPORT.txt index 67c0d5632a..f9bc19ca09 100644 --- a/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/sfas-integration/_tests_/sfas-files/SFAS-TO-SIMS-2024MAR21-PT-APPLICATION-DATA-IMPORT.txt +++ b/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/sfas-integration/_tests_/sfas-files/SFAS-TO-SIMS-2024MAR21-PT-APPLICATION-DATA-IMPORT.txt @@ -1,5 +1,6 @@ -100AESTSFAS TO SIMS BRIDGE 20240314092935 -30109500003602023P19865202308012024020100000040000000000300000003000000000001650000000024000000050020232024 -30109500003612023P19866202308012024020100000050000000000400000004000000000001660000000025000000060020232024 -30109500003622023P198672023080120240201000000600000000005000000050000000000016700000000260000000700 +100AESTSFAS TO SIMS BRIDGE 20240314092935 +30109500003602023P19865202308012024020100000040000000000300000003000000000001650000000024000000050020232024 +30109500003612023P19866202308012024020100000050000000000400000004000000000001660000000025000000060020232024 +30109500003622023P198672023080120240201000000600000000005000000050000000000016700000000260000000700 +30109500003632023P1986820230801202402010000007000000000060000000600000000000168000000002700000008002023202420240201 999000057213000012417587700 \ No newline at end of file diff --git a/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/sfas-integration/_tests_/sfas-integration.scheduler.e2e-spec.ts b/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/sfas-integration/_tests_/sfas-integration.scheduler.e2e-spec.ts index e8fac8b70e..88cf5d14f1 100644 --- a/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/sfas-integration/_tests_/sfas-integration.scheduler.e2e-spec.ts +++ b/sources/packages/backend/apps/queue-consumers/src/processors/schedulers/sfas-integration/_tests_/sfas-integration.scheduler.e2e-spec.ts @@ -253,7 +253,7 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => { // Expect the file was archived on SFTP. expect(sftpClientMock.rename).toHaveBeenCalled(); // Expect the file contains 3 records. - expect(mockedJob.containLogMessage("File contains 3 records.")).toBe( + expect(mockedJob.containLogMessage("File contains 4 records.")).toBe( true, ); const startDate = getISODateOnlyString("2023-08-01"); @@ -270,17 +270,19 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => { bcagAward: true, cslpAward: true, programYearId: true, + applicationCancelDate: true, }, where: { - individualId: In([950000360, 950000361, 950000362]), + individualId: In([950000360, 950000361, 950000362, 950000363]), }, order: { individualId: "ASC" }, }); - expect(sfasPartTimeApplications.length).toBe(3); + expect(sfasPartTimeApplications.length).toBe(4); const [ firstSFASPartTimeApplication, secondSFASPartTimeApplication, thirdSFASPartTimeApplication, + fourthSFASPartTimeApplication, ] = sfasPartTimeApplications; expect(firstSFASPartTimeApplication).toEqual({ startDate: startDate, @@ -292,6 +294,7 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => { bcagAward: 24, cslpAward: 500, programYearId: 20232024, + applicationCancelDate: null, }); expect(secondSFASPartTimeApplication).toEqual({ startDate: startDate, @@ -303,6 +306,7 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => { bcagAward: 25, cslpAward: 600, programYearId: 20232024, + applicationCancelDate: null, }); expect(thirdSFASPartTimeApplication).toEqual({ startDate: startDate, @@ -314,6 +318,19 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => { bcagAward: 26, cslpAward: 700, programYearId: null, + applicationCancelDate: null, + }); + expect(fourthSFASPartTimeApplication).toEqual({ + startDate: startDate, + endDate: endDate, + csgpAward: 7000, + sbsdAward: 600, + csptAward: 60000, + csgdAward: 168, + bcagAward: 27, + cslpAward: 800, + programYearId: 20232024, + applicationCancelDate: "2024-02-01", }); }, ); diff --git a/sources/packages/backend/libs/integrations/src/services/sfas/sfas-part-time-application-import.service.ts b/sources/packages/backend/libs/integrations/src/services/sfas/sfas-part-time-application-import.service.ts index 2e0f6f7a25..fa9b90430a 100644 --- a/sources/packages/backend/libs/integrations/src/services/sfas/sfas-part-time-application-import.service.ts +++ b/sources/packages/backend/libs/integrations/src/services/sfas/sfas-part-time-application-import.service.ts @@ -49,6 +49,9 @@ export class SFASPartTimeApplicationsImportService application.bcagAward = sfasApplication.bcagAward; application.cslpAward = sfasApplication.cslpAward; application.programYearId = sfasApplication.programYearId; + application.applicationCancelDate = getISODateOnlyString( + sfasApplication.applicationCancelDate, + ); await this.repo.save(application, { reload: false, transaction: false }); } diff --git a/sources/packages/backend/libs/integrations/src/sfas-integration/sfas-files/sfas-part-time-application-record.ts b/sources/packages/backend/libs/integrations/src/sfas-integration/sfas-files/sfas-part-time-application-record.ts index a7bfd0bc41..32d5671d06 100644 --- a/sources/packages/backend/libs/integrations/src/sfas-integration/sfas-files/sfas-part-time-application-record.ts +++ b/sources/packages/backend/libs/integrations/src/sfas-integration/sfas-files/sfas-part-time-application-record.ts @@ -89,4 +89,10 @@ export class SFASPartTimeApplicationRecord extends SFASRecordIdentification { ? +this.line.substring(99, 99 + 8).trim() : null; } + /** + * Date that this application was cancelled (sail_application_events.event_date). + */ + get applicationCancelDate(): Date | null { + return parseDate(this.line.substring(107, 107 + 8)); + } } diff --git a/sources/packages/backend/libs/sims-db/src/entities/sfas-part-time-application.model.ts b/sources/packages/backend/libs/sims-db/src/entities/sfas-part-time-application.model.ts index c2d8e8272a..d75ccc8d6c 100644 --- a/sources/packages/backend/libs/sims-db/src/entities/sfas-part-time-application.model.ts +++ b/sources/packages/backend/libs/sims-db/src/entities/sfas-part-time-application.model.ts @@ -110,4 +110,13 @@ export class SFASPartTimeApplications extends BaseSFASApplicationModel { nullable: true, }) programYearId?: number; + /** + * Date that this application was cancelled (sail_application_events.event_date). + */ + @Column({ + name: "application_cancel_date", + type: "date", + nullable: true, + }) + applicationCancelDate?: string; }