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

#4024 - SFAS to SIMS Bridge - CSL/BCSL Overawards - PR 2 #4251

Merged

Conversation

lewischen-aot
Copy link
Collaborator

@lewischen-aot lewischen-aot commented Jan 15, 2025

  • Created a DB migration to delete the records from table sims.disbursement_overawards where the origin type is "Legacy overaward".
  • Created an E2E test to ensure that disbursement over awards records are created during student internal creation with exact match from SFAS individual data records.
  • Created a SQL script in the description for the release instruction to "ensure that bridge file process is stopped during release process for this ticket".
UPDATE
    sims.queue_configurations 
SET is_active = false
WHERE queue_name = 'sfas-integration';

Rollback evidence

Screenshot 2025-01-15 154033

Please note that the down method for the DB migration class doesn't contain a revert script for rollback, where a comment is used instead to explain the reason and recovery process.

@lewischen-aot lewischen-aot self-assigned this Jan 15, 2025
@lewischen-aot lewischen-aot added SIMS-Api SIMS-Api E2E/Unit tests DB DB migration involved labels Jan 15, 2025
@lewischen-aot lewischen-aot changed the title SFAS to SIMS Bridge - CSL/BCSL Overawards#4024 #4024 - SFAS to SIMS Bridge - CSL/BCSL Overawards - PR 2 Jan 16, 2025
@lewischen-aot lewischen-aot marked this pull request as ready for review January 16, 2025 00:08
@@ -245,6 +245,73 @@ describe("StudentAccountApplicationAESTController(e2e)-approveStudentAccountAppl
});
});

it("Should create disbursement overawards when an exact match is found with matching last name, birth dates and SIN for importing a student record with disbursement overawards from SFAS.", async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a valid test and we can keep it, it is just not the code that would revert the deleted records.
The process would happen during the execution of the SFAS scheduler (sfas-integration.scheduler) during the updateDisbursementOverawards.
To create an E2E test, it needs to be under queue-consumers importing an SFAS bridge record for an individual with overawards data.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@andrewsignori-aot I have some confusion related to the test organization. I thought we put tests in their respective place based on the api the test is invoking. Am I missing something?

I am guessing the idea is to put it with queue-consumers because it tests the scheduler's job of updating the overawards if a sims and sfas student match is found.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sh16011993 the current test is this tile is testing the API call and should stay where it is.
My comment, if not clear, is to have a second E2E test created for the queue-consumers.
legacy overawards are imported during student account creation and during the SFAS bridge process.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Changes looks good, the E2E created makes sense for the student creation scenario but the most critical to ensure the data would be recovered if deleted would be the one in queue-consumers. I added the details on the comment, please let me know if need further information.

Copy link
Collaborator

@sh16011993 sh16011993 left a comment

Choose a reason for hiding this comment

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

Nice work @lewischen-aot 👍

Comment on lines 584 to 598
const disbursementOverawards = await db.disbursementOveraward.find({
select: { overawardValue: true },
where: {
student: { id: student.id },
originType: DisbursementOverawardOriginType.LegacyOveraward,
},
});
expect(disbursementOverawards).toEqual(
expect.arrayContaining([
{ overawardValue: 714.3 },
{ overawardValue: 741.3 },
]),
);
},
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding the E2E test to assert the import. While validating the disbursement overawards, please also validate each overward against the code.

const disbursementOverawards = await db.disbursementOveraward.find({
        select: { disbursementValueCode: true, overawardValue: true },
        where: {
          student: { id: student.id },
          originType: DisbursementOverawardOriginType.LegacyOveraward,
        },
      });
      expect(disbursementOverawards).toEqual(
        expect.arrayContaining([
          {
            disbursementValueCode: BC_STUDENT_LOAN_AWARD_CODE,
            overawardValue: 714.3,
          },
          {
            disbursementValueCode: CANADA_STUDENT_LOAN_FULL_TIME_AWARD_CODE,
            overawardValue: 741.3,
          },
        ]),
      );

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.51% ( 3864 / 17162 )
Methods: 10.33% ( 224 / 2169 )
Lines: 25.92% ( 3336 / 12869 )
Branches: 14.31% ( 304 / 2124 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 86.14% ( 1249 / 1450 )
Methods: 82.42% ( 136 / 165 )
Lines: 88.51% ( 1032 / 1166 )
Branches: 68.07% ( 81 / 119 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 68.09% ( 6022 / 8844 )
Methods: 65.84% ( 742 / 1127 )
Lines: 71.92% ( 4715 / 6556 )
Branches: 48.66% ( 565 / 1161 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.59% ( 589 / 898 )
Methods: 59.63% ( 65 / 109 )
Lines: 68.72% ( 468 / 681 )
Branches: 51.85% ( 56 / 108 )

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 doing the changes @lewischen-aot. Looks good👍

@lewischen-aot lewischen-aot deleted the feature/#4024-sfas-sims-bridge-csl-bcsl-overawards-part-2 branch January 17, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DB DB migration involved E2E/Unit tests SIMS-Api SIMS-Api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants