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

#4101 - SIMS to SFAS Bridge - Legacy Restrictions #4158

Merged
merged 9 commits into from
Dec 20, 2024

Conversation

andrepestana-aot
Copy link
Collaborator

@andrepestana-aot andrepestana-aot commented Dec 19, 2024

  • Filtered legacy restrictions that are going to be sent to SFAS;
  • Formatted restriction field to have a minimum of 10 characters in the file;
  • Added a legacy restriction to the e2e test.
    image

@andrepestana-aot andrepestana-aot marked this pull request as ready for review December 19, 2024 23:54
@@ -824,7 +844,10 @@ describe(describeProcessorRootTest(QueueNames.SIMSToSFASIntegration), () => {
: " ";
return `400${studentId.toString().padStart(10, "0")}${studentRestriction.id
.toString()
.padStart(10, "0")}${restriction.restrictionCode}${formatDate(
.padStart(10, "0")}${restriction.restrictionCode.padEnd(
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

application,
restriction: legacyRestriction,
});

Copy link
Collaborator

@dheepak-aot dheepak-aot Dec 20, 2024

Choose a reason for hiding this comment

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

Please set the updated date of legacy restriction to fall under the delta period using simsDataUpdatedDate

// Student has a legacy restriction that should be ignored.
      const legacyStudentRestriction = await saveFakeStudentRestriction(
        db.dataSource,
        {
          student,
          application,
          restriction: legacyRestriction,
        },
      );

      await db.studentRestriction.update(
        {
          id: legacyStudentRestriction.id,
        },
        {
          updatedAt: simsDataUpdatedDate,
        },
      );

Copy link
Collaborator

Choose a reason for hiding this comment

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

My bad. I didn't see that it was set in the save.

But also please use the factory to create restriction createFakeRestriction instead of saving it directly.

@guru-aot guru-aot self-requested a review December 20, 2024 17:11
@@ -234,6 +234,7 @@ export class SIMSToSFASService {
where: {
restriction: {
restrictionType: RestrictionType.Provincial,
isLegacy: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@@ -35,7 +35,7 @@ export class SIMSToSFASRestrictionRecord extends SIMSToSFASBaseRecord {
record.append(this.recordTypeCode);
record.appendNumberWithFiller(this.studentId, 10);
record.appendNumberWithFiller(this.restrictionId, 10);
record.append(this.restrictionCode);
record.appendStringWithFiller(this.restrictionCode, 10);
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

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

LGTM, nice work @andrepestana-aot

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.08% ( 3783 / 17133 )
Methods: 10.07% ( 219 / 2175 )
Lines: 25.47% ( 3278 / 12868 )
Branches: 13.68% ( 286 / 2090 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.43% ( 583 / 891 )
Methods: 59.26% ( 64 / 108 )
Lines: 68.54% ( 464 / 677 )
Branches: 51.89% ( 55 / 106 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 81.73% ( 1302 / 1593 )
Methods: 67.51% ( 133 / 197 )
Lines: 84.9% ( 1091 / 1285 )
Branches: 70.27% ( 78 / 111 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 67.4% ( 5922 / 8787 )
Methods: 65.09% ( 729 / 1120 )
Lines: 71.33% ( 4647 / 6515 )
Branches: 47.4% ( 546 / 1152 )

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes . Looks good @andrepestana-aot .👍

@andrepestana-aot andrepestana-aot added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 658c753 Dec 20, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants