VPR-64 feat(phone): schoolwide and unit phone lists - #323
Conversation
Bundle ReportChanges will increase total bundle size by 999 bytes (0.04%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: viper-frontend-esmAssets Changed:
Files in
|
|
@coderabbitai full review |
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the schoolwide (SVM) and Dean's Office (VMDO) phone lists from Viper 1 into a new Personnel area, backed by a new normalized phones schema in the VIPER database. Viewing requires basic SVMSecure permission, while a new SVMSecure.PhoneLists.SVMMaintain permission (and per-list MaintainRole) gates editing. It adds EF Core models/services/controllers plus a full Vue 3/Quasar SPA, and refactors shared person-search logic into a reusable PersonSearchHelper used by both CMS and Personnel.
Changes:
- New
phonesschema +PhonesDbContext, EF models, area services and/api/phones/...controllers with dynamic per-list maintain permissions and direct-number masking. - New Personnel Vue SPA (lists, maintenance views, person selector, record dialogs) plus data-migration scripts from the legacy PhoneList database.
- Shared
PersonSearchHelperextracted and adopted by CMS'sSearchPeople, forcing EF parameterization (ESCAPE clause) to prevent per-term query plans and%/_wildcard injection.
Reviewed changes
Copilot reviewed 121 out of 122 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web/Viper.csproj | Excludes Areas\Personnel\Scripts\** (separate migration project) from the web build, mirroring the Effort area. |
| web/Program.cs | Registers PhonesDbContext, adds Personnel SPA name and the Personnel services namespace to Scrutor registration. |
| web/Classes/Utilities/PersonSearchHelper.cs | New shared expression-tree helper for name-search autocomplete with parameterized Contains matching. |
| web/Areas/Personnel/Services/PhoneSVMSectionService.cs | Read-only query for SVM sections, ordered with null-safe sort. |
| web/Areas/Personnel/Services/PhoneSVMFrequentNumberService.cs | CRUD + soft-delete for SVM frequent numbers, with modified-date tracking. |
| web/Areas/Personnel/Services/PhonePersonLookupService.cs | Looks up phone people by IAM IDs (direct number masked unless maintainer) and current-employee search. |
| web/Areas/Personnel/Services/PhonePermissionsService.cs | Resolves edit permission from the list's MaintainRole column. |
| web/Areas/Personnel/Controllers/PhonePersonController.cs | Person-picker endpoint merging Viper and phone data; uses foreach/Add where .Select() is preferred. |
| web/Areas/Personnel/Controllers/PhoneSVMModifiedDateController.cs | Returns latest SVM modified date; contains a comment typo ("Identfies"). |
| web/Areas/Personnel/Models/*, VueApp/src/Personnel/** | New EF models/DTOs/Mapperly mapper and the Personnel Vue SPA (services, composables, components, tests). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| List<string> iamIds = []; | ||
| foreach (ViperPerson result in viperResults) | ||
| { | ||
| iamIds.Add(result.IamId); | ||
| } |
| private readonly PhoneSVMUnitService _phoneSVMUnitService = phoneSVMUnitService; | ||
|
|
||
| /// <summary> | ||
| /// Identfies when frequent numbers were last modified. |
This PR migrates the schoolwide and Dean's Office phone lists from Viper 1. Viewing the lists requires only basic permissions, while specific permissions allow users to edit and maintain the lists. The lists are now housed in the new Personnel area.
The migration makes the following functional changes from the Viper 1 version:
This PR also does some refactoring around Person selection and dialog boxes. There should be no end user impact to CMS, but a few files are affected.
This PR requires schema changes to the Production database:
This PR requires creating a new permission on Production: SVMSecure.PhoneLists.SVMMaintain.
This PR requires running the migration script
.\RunMigrateData.bat Productionfor a dry run, and then.\RunMigrateData.bat Production --applyto migrate data into the new schema.