-
Notifications
You must be signed in to change notification settings - Fork 14
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
#3453 - COE for $0/Not Eligible Assessments - Part 2 #4027
#3453 - COE for $0/Not Eligible Assessments - Part 2 #4027
Conversation
sims.report_configs | ||
SET | ||
report_sql = ( | ||
'SELECT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if you need help with the formatting.
...ons/src/services/disbursement-schedule/e-cert-processing-steps/validate-disbursement-base.ts
Show resolved
Hide resolved
...ackend/libs/integrations/src/services/disbursement-schedule/disbursement-schedule.service.ts
Show resolved
Hide resolved
...ages/backend/libs/services/src/disbursement-schedule/disbursement-schedule-shared.service.ts
Outdated
Show resolved
Hide resolved
...nsumers/src/processors/schedulers/esdc-integration/ecert-integration/_tests_/e-cert-utils.ts
Show resolved
Hide resolved
...route-controllers/report/_tests_/e2e/report.institutions.controller.exportReport.e2e-spec.ts
Outdated
Show resolved
Hide resolved
...route-controllers/report/_tests_/e2e/report.institutions.controller.exportReport.e2e-spec.ts
Outdated
Show resolved
Hide resolved
Great Job @lewischen-aot . Please have a look at the comments. Most of them are minor comments. Also please add a E2E test for ECE as per the technical AC. |
...tion-integration/ece-request/_tests_/ecert-request-process-integration.scheduler.e2e-spec.ts
Outdated
Show resolved
Hide resolved
...tion-integration/ece-request/_tests_/ecert-request-process-integration.scheduler.e2e-spec.ts
Outdated
Show resolved
Hide resolved
...tion-integration/ece-request/_tests_/ecert-request-process-integration.scheduler.e2e-spec.ts
Outdated
Show resolved
Hide resolved
|
||
beforeEach(async () => { | ||
jest.clearAllMocks(); | ||
// Ensures that every disbursement on database has no estimated awards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the comment. It seems to be moved over from e-certs.
...tion-integration/ece-request/_tests_/ecert-request-process-integration.scheduler.e2e-spec.ts
Outdated
Show resolved
Hide resolved
...tion-integration/ece-request/_tests_/ecert-request-process-integration.scheduler.e2e-spec.ts
Outdated
Show resolved
Hide resolved
...tion-integration/ece-request/_tests_/ecert-request-process-integration.scheduler.e2e-spec.ts
Outdated
Show resolved
Hide resolved
}), | ||
}, | ||
{ | ||
offeringIntensity: OfferingIntensity.fullTime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(fileDetail).toContain( | ||
application.currentAssessment.offering.institutionLocation | ||
.institutionCode, | ||
); | ||
expect(fileDetail).toContain(disbursementValue.id.toString()); | ||
expect(fileDetail).toContain(disbursementValue.valueCode.toString()); | ||
expect(fileDetail).toContain(disbursementValue.valueAmount.toString()); | ||
expect(fileDetail).toContain( | ||
application.student.user.lastName.slice(0, 25), | ||
); | ||
expect(fileDetail).toContain( | ||
application.student.user.firstName.slice(0, 15), | ||
); | ||
expect(fileDetail).toContain(application.applicationNumber); | ||
expect(fileDetail).toContain(application.studentNumber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend the file detail to assert exact match instead of contain.
I can be achieved by creating a parser.
function buildECEFileDetail(
application: Application,
disbursementValue: DisbursementValue,
disbursementDate: string,
): string {
const DATE_FORMAT = "YYYYMMDD";
const offering = application.currentAssessment.offering;
const studyStartDate = formatDate(offering.studyStartDate, DATE_FORMAT);
const studyEndDate = formatDate(offering.studyEndDate, DATE_FORMAT);
const disbursementDateFormatted = formatDate(
disbursementDate,
DATE_FORMAT,
);
const institutionLocation = offering.institutionLocation;
const student = application.student;
const studentFirstName = student.user.firstName?.substring(0, 15) ?? "";
const studentLastName = student.user.lastName.substring(0, 25);
const studentBirthDate = formatDate(student.birthDate, DATE_FORMAT);
const institutionStudentNumber = application.studentNumber;
return `${RecordTypeCodes.ECEDetail}${
institutionLocation.institutionCode
}${disbursementValue.id.toString().padStart(10, "0")}${
disbursementValue.valueCode
}${disbursementValue.valueAmount.toString().padStart(9, "0")}${
student.sinValidation.sin
}${studentLastName.padEnd(25, " ")}${studentFirstName.padEnd(
15,
" ",
)}${studentBirthDate}${
application.applicationNumber
}${institutionStudentNumber.padEnd(
12,
" ",
)}100${studyStartDate}${studyEndDate}${disbursementDateFormatted}`;
}
and calling the parser like this.
const [disbursement] =
application.currentAssessment.disbursementSchedules;
const [disbursementValue] = disbursement.disbursementValues;
const expectedDetailRecord = buildECEFileDetail(
application,
disbursementValue,
disbursement.disbursementDate,
);
expect(fileDetail).toBe(expectedDetailRecord);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(fileDetail).toContain(application.applicationNumber); | ||
expect(fileDetail).toContain(application.studentNumber); | ||
// Expect the footer contain only 1 disbursement schedule. | ||
expect(footer).toContain("1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please assert the footer like this.
expect(footer).toBe("3000001");
import * as Client from "ssh2-sftp-client"; | ||
import * as dayjs from "dayjs"; | ||
|
||
describe(QueueNames.ECEProcessIntegration, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the util describeQueueProcessorRootTest(QueueNames.ECEProcessIntegration)
to follow other scheduler descriptions
// Ensures that every institution location on database has no integration. | ||
// to allow the e-Certs to be generated with the data created for every | ||
// specific scenario. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments still say e-cert. Please adjust the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the changes. Looks good 👍
Please address the 2 minor comments before merge.
Quality Gate passedIssues Measures |
}, | ||
}, | ||
); | ||
application.studentNumber = "1234567789"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the studentNumber
? That is nullable in sims.applications
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change buildECEFileDetail
to do not require application.studentNumber
as it's not required for the e-Cert generation. (Edit: I meant ECE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @andrepestana-aot. I also thought that student number was not required, until the E2E test failed due to the null value from institutionStudentNumber
used by the following code in the method getFixedFormat()
in ece-file-detail.ts:
record.appendWithEndFiller(
this.institutionStudentNumber,
12,
SPACE_FILLER,
);
In this case, institutionStudentNumber
is studentNumber
obtained from another method. When the value institutionStudentNumber
is null, the method appendWithEndFiller
will raise a type error as shown below.
Setting a value for studentNumber
for the application in the E2E test will make it pass. In short, student number should be a mandatory field for submitting student applications, and the ECE request process integration ensures that student number is required. If there is any further doubts about this, I think we can raise the question in DEV meetings and make corresponding changes in separate story.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see. That is required for the ECE integration. Thanks for checking. We can confirm that later with other DEVS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! Just a minor comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking my question. Looks good!
This PR resolves the following business AC:
This PR covers the changes for COE Request report and e-Cert integration/queue consumer.
Rollback Evidence