-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Report Creation - [x] Created a new dynamic report `CAS Supplier Maintenance Updates` which captures the updates from student since their CAS Supplier is set to be valid.   - [x] To identify the students who had one or more updates to their profile from CAS perspective, student profile data is compared with the `student_profile_snapshot` column of CAS supplier. **Note**: All the data comparisons are string comparison ignoring the case. - [x] Data is sorted by `sims.students.updated_at` - [x] Byte Order Mark Update: Update the code to NOT add the BYTE ORDER MARK character when report is empty as it is not required. ## Rollback Evidence  ## E2E Tests - [x] Added E2E tests to validate the report data when student updates their - Last name - SIN - Address line 1 - Postal code - [x] Added E2E test to ensure the comparison of data is not case sensitive. (Used last name as scenario). 
- v2.5.0-5533
- v2.4.0-5303
- v2.4.0-5294
- v2.3.0-5205
- v2.3.0-5184
- v2.3.0-5106
- v2.3.0-5056
- v2.2.0-5087
- v2.2.0-4944
- v2.2.0-4939
- v2.2.0-4859
- main-5630
- main-5621
- main-5609
- main-5606
- main-5602
- main-5599
- main-5596
- main-5594
- main-5591
- main-5576
- main-5549
- main-5538
- main-5525
- main-5520
- main-5510
- main-5503
- main-5502
- main-5493
- main-5491
- main-5488
- main-5478
- main-5462
- main-5457
- main-5455
- main-5452
- main-5451
- main-5431
- main-5428
- main-5426
- main-5410
- main-5399
- main-5397
- main-5393
- main-5378
- main-5373
- main-5367
- main-5354
- main-5350
- main-5348
- main-5322
- main-5313
- main-5301
- main-5298
- main-5289
- main-5283
- main-5282
- main-5277
- main-5271
- main-5269
- main-5268
- main-5257
- main-5247
- main-5244
- main-5242
- main-5239
- main-5231
- main-5228
- main-5227
- main-5220
- main-5214
- main-5203
- main-5200
- main-5188
- main-5183
- main-5175
- main-5170
- main-5167
- main-5156
- main-5149
- main-5109
- main-5094
- main-5082
- main-5076
- main-5057
- main-5055
- main-5052
- main-5045
- main-5042
- main-5041
- main-5040
- main-5031
- main-5020
- main-5018
- main-5016
- main-5011
- main-5007
- main-5003
- main-4995
- main-4994
- main-4982
- main-4980
- main-4977
- main-4975
- main-4951
- main-4947
- main-4937
- main-4921
- main-4909
- main-4904
- main-4898
- main-4893
- main-4879
- main-4875
- main-4858
- main-4857
- main-4849
- main-4848
- main-4847
- main-4839
- install-oc-github-actions-4889
- install-oc-github-actions-4885
- fix/install-oc-github-actions-4884
- fix/install-oc-github-actions-4883
- feature/#3719-nodejs-upgrade-5337
- feature/#3719-nodejs-upgrade-5332
- 3719-nodejs-upgrade-5364
- 3719-nodejs-upgrade-5346
- 3719-nodejs-upgrade-5339
1 parent
7a58eb3
commit 9547f75
Showing
12 changed files
with
575 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ackend/apps/db-migrations/src/migrations/1733340941443-AddCASSupplierMaintenanceReport.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { getSQLFileData } from "../utilities/sqlLoader"; | ||
|
||
export class AddCASSupplierMaintenanceReport1733340941443 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData( | ||
"Create-cas-supplier-maintenance-updates-report.sql", | ||
"Reports", | ||
), | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData( | ||
"Rollback-create-cas-supplier-maintenance-updates-report.sql", | ||
"Reports", | ||
), | ||
); | ||
} | ||
} |
139 changes: 139 additions & 0 deletions
139
...end/apps/db-migrations/src/sql/Reports/Create-cas-supplier-maintenance-updates-report.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
INSERT INTO | ||
sims.report_configs (report_name, report_sql) | ||
VALUES | ||
( | ||
'CAS_Supplier_Maintenance_Updates_Report', | ||
'WITH cas_supplier_report AS ( | ||
SELECT | ||
COALESCE(student_user.first_name, '''') AS student_first_name, | ||
student_user.last_name AS student_last_name, | ||
student_user.identity_provider_type AS student_profile_type, | ||
student.updated_at AS student_updated_date, | ||
student.disability_status AS student_disability_status, | ||
sin_validation.sin AS student_sin, | ||
student.contact_info -> ''address'' ->> ''addressLine1'' AS student_address_line_1, | ||
student.contact_info -> ''address'' ->> ''city'' AS student_city, | ||
COALESCE( | ||
student.contact_info -> ''address'' ->> ''provinceState'', | ||
'''' | ||
) AS student_province, | ||
student.contact_info -> ''address'' ->> ''postalCode'' AS student_postal_code, | ||
student.contact_info -> ''address'' ->> ''country'' AS student_country, | ||
cas_supplier.supplier_number AS cas_supplier, | ||
cas_supplier.supplier_protected AS cas_supplier_protected, | ||
cas_supplier.supplier_address ->> ''supplierSiteCode'' AS cas_site, | ||
cas_supplier.supplier_address ->> ''siteProtected'' AS cas_site_protected, | ||
cas_supplier.supplier_status_updated_on AS cas_supplier_verified_date, | ||
COALESCE( | ||
cas_supplier.student_profile_snapshot ->> ''firstName'', | ||
'''' | ||
) AS cas_snapshot_first_name, | ||
COALESCE( | ||
cas_supplier.student_profile_snapshot ->> ''lastName'', | ||
'''' | ||
) AS cas_snapshot_last_name, | ||
COALESCE( | ||
cas_supplier.student_profile_snapshot ->> ''sin'', | ||
'''' | ||
) AS cas_snapshot_sin, | ||
COALESCE( | ||
cas_supplier.student_profile_snapshot ->> ''addressLine1'', | ||
'''' | ||
) AS cas_snapshot_address_line_1, | ||
COALESCE( | ||
cas_supplier.student_profile_snapshot ->> ''city'', | ||
'''' | ||
) AS cas_snapshot_city, | ||
COALESCE( | ||
cas_supplier.student_profile_snapshot ->> ''province'', | ||
'''' | ||
) AS cas_snapshot_province, | ||
COALESCE( | ||
cas_supplier.student_profile_snapshot ->> ''postalCode'', | ||
'''' | ||
) AS cas_snapshot_postal_code, | ||
COALESCE( | ||
cas_supplier.student_profile_snapshot ->> ''country'', | ||
'''' | ||
) AS cas_snapshot_country | ||
FROM | ||
sims.students student | ||
INNER JOIN sims.cas_suppliers cas_supplier on student.cas_supplier_id = cas_supplier.id | ||
INNER JOIN sims.users student_user on student.user_id = student_user.id | ||
INNER JOIN sims.sin_validations sin_validation on student.sin_validation_id = sin_validation.id | ||
WHERE | ||
cas_supplier.is_valid = true | ||
AND ( | ||
jsonb_build_object( | ||
''firstName'', | ||
student_user.first_name, | ||
''lastName'', | ||
student_user.last_name, | ||
''sin'', | ||
sin_validation.sin, | ||
''addressLine1'', | ||
student.contact_info -> ''address'' ->> ''addressLine1'', | ||
''city'', | ||
student.contact_info -> ''address'' ->> ''city'', | ||
''province'', | ||
student.contact_info -> ''address'' ->> ''provinceState'', | ||
''postalCode'', | ||
student.contact_info -> ''address'' ->> ''postalCode'', | ||
''country'', | ||
student.contact_info -> ''address'' ->> ''country'' | ||
) :: text NOT ILIKE jsonb_build_object( | ||
''firstName'', | ||
cas_supplier.student_profile_snapshot ->> ''firstName'', | ||
''lastName'', | ||
cas_supplier.student_profile_snapshot ->> ''lastName'', | ||
''sin'', | ||
cas_supplier.student_profile_snapshot ->> ''sin'', | ||
''addressLine1'', | ||
cas_supplier.student_profile_snapshot ->> ''addressLine1'', | ||
''city'', | ||
cas_supplier.student_profile_snapshot ->> ''city'', | ||
''province'', | ||
cas_supplier.student_profile_snapshot ->> ''province'', | ||
''postalCode'', | ||
cas_supplier.student_profile_snapshot ->> ''postalCode'', | ||
''country'', | ||
cas_supplier.student_profile_snapshot ->> ''country'' | ||
) :: text | ||
) | ||
) | ||
SELECT | ||
cas_supplier_report.student_first_name AS "Given Names", | ||
cas_supplier_report.student_last_name AS "Last Name", | ||
cas_supplier_report.student_sin AS "SIN", | ||
cas_supplier_report.student_address_line_1 AS "Address Line 1", | ||
cas_supplier_report.student_city AS "City", | ||
cas_supplier_report.student_province AS "Province", | ||
cas_supplier_report.student_postal_code AS "Postal Code", | ||
cas_supplier_report.student_country AS "Country", | ||
cas_supplier_report.student_disability_status AS "Disability Status", | ||
cas_supplier_report.student_profile_type AS "Profile Type", | ||
TO_CHAR( | ||
(cas_supplier_report.student_updated_date AT TIME ZONE ''America/Vancouver''), | ||
''YYYY-MM-DD'' | ||
) AS "Student Updated Date", | ||
cas_supplier_report.cas_supplier AS "Supplier", | ||
cas_supplier_report.cas_site AS "Site", | ||
cas_supplier_report.cas_supplier_protected AS "Protected Supplier", | ||
cas_supplier_report.cas_site_protected AS "Protected Site", | ||
TO_CHAR( | ||
(cas_supplier_report.cas_supplier_verified_date AT TIME ZONE ''America/Vancouver''), | ||
''YYYY-MM-DD'' | ||
) AS "Supplier Verified Date", | ||
cas_supplier_report.student_first_name NOT ILIKE cas_supplier_report.cas_snapshot_first_name AS "First Name Updated", | ||
cas_supplier_report.student_last_name NOT ILIKE cas_supplier_report.cas_snapshot_last_name AS "Last Name Updated", | ||
cas_supplier_report.student_sin NOT ILIKE cas_supplier_report.cas_snapshot_sin AS "SIN Updated", | ||
cas_supplier_report.student_address_line_1 NOT ILIKE cas_supplier_report.cas_snapshot_address_line_1 AS "Address Line 1 Updated", | ||
cas_supplier_report.student_city NOT ILIKE cas_supplier_report.cas_snapshot_city AS "City Updated", | ||
cas_supplier_report.student_province NOT ILIKE cas_supplier_report.cas_snapshot_province AS "Province Updated", | ||
cas_supplier_report.student_postal_code NOT ILIKE cas_supplier_report.cas_snapshot_postal_code AS "Postal Code Updated", | ||
cas_supplier_report.student_country NOT ILIKE cas_supplier_report.cas_snapshot_country AS "Country Updated" | ||
FROM | ||
cas_supplier_report | ||
ORDER BY | ||
student_updated_date;' | ||
); |
4 changes: 4 additions & 0 deletions
4
...db-migrations/src/sql/Reports/Rollback-create-cas-supplier-maintenance-updates-report.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DELETE from | ||
sims.report_configs | ||
WHERE | ||
report_name = 'CAS_Supplier_Maintenance_Updates_Report'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters