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

#4133 - SFAS to SIMS Bridge - PT App Cancellation Date & MSFAA (FT/PT) Change - part 2 #4178

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
100AESTSFAS TO SIMS BRIDGE 20240314092935
30109500003602023P19865202308012024020100000040000000000300000003000000000001650000000024000000050020232024
30109500003612023P19866202308012024020100000050000000000400000004000000000001660000000025000000060020232024
30109500003622023P198672023080120240201000000600000000005000000050000000000016700000000260000000700
100AESTSFAS TO SIMS BRIDGE 20240314092935
30109500003602023P19865202308012024020100000040000000000300000003000000000001650000000024000000050020232024
30109500003612023P19866202308012024020100000050000000000400000004000000000001660000000025000000060020232024
30109500003622023P198672023080120240201000000600000000005000000050000000000016700000000260000000700
30109500003632023P1986820230801202402010000007000000000060000000600000000000168000000002700000008002023202420240201
999000057213000012417587700
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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,
Expand All @@ -292,6 +294,7 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => {
bcagAward: 24,
cslpAward: 500,
programYearId: 20232024,
applicationCancelDate: null,
});
expect(secondSFASPartTimeApplication).toEqual({
startDate: startDate,
Expand All @@ -303,6 +306,7 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => {
bcagAward: 25,
cslpAward: 600,
programYearId: 20232024,
applicationCancelDate: null,
});
expect(thirdSFASPartTimeApplication).toEqual({
startDate: startDate,
Expand All @@ -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",
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

});
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Loading