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

#4013 - Legacy Restriction Mapping - Migrations and SQL Changes #4037

Conversation

andrewsignori-aot
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot commented Dec 6, 2024

  • Created a new table to map SFAS code to SIMS legacy restriction codes.
    • New records added to the table map will be automatically added to the sims.restrcitions if not present yet.
    • The column is_legacy_only creates a distinction between the SFAS-SIMS mapped restriction and the restrictions that should be added to SIMS but not managed (only resolved).
  • Kept generating a notification for each student that had a new legacy restriction added.
    • The creation date is controlled and the query to get students looks for any new student restriction created by the import process.

Rollback

image

image

@andrewsignori-aot andrewsignori-aot added Queue Consumers Hotfix PR created for hotfix labels Dec 6, 2024
@andrewsignori-aot andrewsignori-aot self-assigned this Dec 6, 2024
@andrewsignori-aot andrewsignori-aot marked this pull request as ready for review December 6, 2024 21:20
@dheepak-aot dheepak-aot self-requested a review December 6, 2024 21:47
@dheepak-aot dheepak-aot added the DB DB migration involved label Dec 6, 2024
is_legacy_only BOOLEAN NOT NULL,
-- Audit columns
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
UNIQUE (legacy_code, code)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

is_legacy_only BOOLEAN NOT NULL,
-- Audit columns
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
UNIQUE (legacy_code, code)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we name the constraint.?

We have been following this pattern looking at recent code.

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Are you talking about the name convention or about executing it in an alter table?

Copy link
Collaborator

Choose a reason for hiding this comment

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

About convention of CONSTRAINT constraint_name UNIQUE (legacy_code, code)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As we talked, we will be keeping this as it is.

@guru-aot guru-aot self-requested a review December 6, 2024 22:59
Comment on lines +57 to +60
const existingRestrictionCodes = this.restrictionRepo
.createQueryBuilder("restriction")
.select("restriction.restrictionCode")
.getSql();
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is suppose to be the outcome if a SIMS federal restriction code is added to mapping by mistake. I see that the system will not create new restriction on-demand. But will we insert a federal restriction as per the existing logic ?? Asking the question as configuration is dynamic now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whatever is added to this table as "legacy only" will become a provincial restriction.
Can you clarify what is the concern here?
The table is added as a configuration option but should be managed with caution.

.select("restriction.restrictionCode")
.getSql();
const missingLegacyOnlyRestrictions =
await this.sfasRestrictionMapRepo.find({
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@dheepak-aot
Copy link
Collaborator

Great and massive work. Thanks for the quick outcome. Please take a look at the comments.

Copy link

sonarqubecloud bot commented Dec 7, 2024

Copy link

github-actions bot commented Dec 7, 2024

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.04% ( 3727 / 16912 )
Methods: 10.15% ( 214 / 2109 )
Lines: 25.37% ( 3235 / 12750 )
Branches: 13.54% ( 278 / 2053 )

Copy link

github-actions bot commented Dec 7, 2024

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

github-actions bot commented Dec 7, 2024

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 84.39% ( 1238 / 1467 )
Methods: 84.51% ( 120 / 142 )
Lines: 85.61% ( 1053 / 1230 )
Branches: 68.42% ( 65 / 95 )

Copy link

github-actions bot commented Dec 7, 2024

E2E SIMS API Coverage Report

Totals Coverage
Statements: 66.94% ( 5774 / 8625 )
Methods: 64.8% ( 718 / 1108 )
Lines: 70.87% ( 4531 / 6393 )
Branches: 46.71% ( 525 / 1124 )

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 👍

@andrewsignori-aot andrewsignori-aot merged commit 0b0f97f into hotfix/v2.1.1 Dec 7, 2024
21 checks passed
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.

Done with my review, LGTM, nice quick work @andrewsignori-aot

@andrewsignori-aot andrewsignori-aot deleted the feature/#4013-legacy-restriction-mapping-part-1 branch December 10, 2024 00:13
github-merge-queue bot pushed a commit that referenced this pull request Dec 11, 2024
Merge Hotfix V2.1.1 to Main

## What's Changed
* #4013 - Legacy Restriction Mapping - Migrations and SQL Changes by
@andrewsignori-aot in #4037
* #4041 - Ignore Cancelled Legacy Applications on SIMS Validations and
Calculations by @dheepak-aot in #4042
* #4013 - Legacy Restriction Mapping - Student Changes by
@andrewsignori-aot in #4049
* #4052 - Fix the legacy program year totals for program year limits by
@dheepak-aot in #4058

---------

Co-authored-by: Andrew Boni Signori <[email protected]>
Co-authored-by: Dheepak Ramanathan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DB DB migration involved Hotfix PR created for hotfix Queue Consumers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants