#3272 - Add Email to Student Search#5663
Conversation
There was a problem hiding this comment.
Pull request overview
Adds “Email address” as an additional search criterion for student search flows (AEST + Institution), wiring it through the web UI, web DTOs, API DTOs, service search query, and e2e coverage.
Changes:
- Added an email input to the shared
SearchStudentscomponent and included it in the search payload/validation. - Extended backend student search to filter by email and updated the API input DTO accordingly.
- Updated/added e2e tests to include the new email field.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sources/packages/web/src/views/institution/student/InstitutionSearchStudents.vue | Makes the institution search page full-width to fit the updated search layout. |
| sources/packages/web/src/views/aest/SearchStudents.vue | Makes the AEST search page full-width to fit the updated search layout. |
| sources/packages/web/src/services/http/dto/Student.dto.ts | Extends the web API input DTO to support email as a search parameter. |
| sources/packages/web/src/components/common/SearchStudents.vue | Adds the email search field and includes it in validation + request payload. |
| sources/packages/backend/apps/api/src/services/student/student.service.ts | Adds email filtering to the backend student search query. |
| sources/packages/backend/apps/api/src/route-controllers/student/models/student.dto.ts | Updates StudentSearchAPIInDTO to include email in the “at least one parameter” validation rules. |
| sources/packages/backend/apps/api/src/route-controllers/student/tests/e2e/student.institutions.controller.searchStudents.e2e-spec.ts | Adds institutions e2e coverage for email search payloads. |
| sources/packages/backend/apps/api/src/route-controllers/student/tests/e2e/student.aest.controller.searchStudents.e2e-spec.ts | Adds AEST e2e coverage for email search + validation error scenario. |
sources/packages/backend/apps/api/src/services/student/student.service.ts
Outdated
Show resolved
Hide resolved
...src/route-controllers/student/_tests_/e2e/student.aest.controller.searchStudents.e2e-spec.ts
Show resolved
Hide resolved
...e-controllers/student/_tests_/e2e/student.institutions.controller.searchStudents.e2e-spec.ts
Show resolved
Hide resolved
| firstName: "", | ||
| lastName: "", | ||
| sin: "", | ||
| email: "StUdEnT@hOtMaIl.cOm", |
...src/route-controllers/student/_tests_/e2e/student.aest.controller.searchStudents.e2e-spec.ts
Show resolved
Hide resolved
...src/route-controllers/student/_tests_/e2e/student.aest.controller.searchStudents.e2e-spec.ts
Outdated
Show resolved
Hide resolved
...src/route-controllers/student/_tests_/e2e/student.aest.controller.searchStudents.e2e-spec.ts
Outdated
Show resolved
Hide resolved
| it("Should find the student by email where there is an exact match.", async () => { | ||
| // Arrange | ||
| const student = await saveFakeStudent(appDataSource); | ||
| student.user.email = "student@mail.com"; |
There was a problem hiding this comment.
Is there a benefit manually updating the email here? I see that the updated value isn't used.
There was a problem hiding this comment.
I just wanted to be explicit about my test data in this case. Happy to use the generated value for this test case if you want.
There was a problem hiding this comment.
I am completely fine with using a particular test data, but from the time we use the variable student.user.email instead of value in the payload, it loses the benefit. This is not a blocker btw.
...src/route-controllers/student/_tests_/e2e/student.aest.controller.searchStudents.e2e-spec.ts
Show resolved
Hide resolved
...e-controllers/student/_tests_/e2e/student.institutions.controller.searchStudents.e2e-spec.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/apps/db-migrations/src/sql/User/Create-index-lowercase-email.sql
Outdated
Show resolved
Hide resolved
| /> | ||
| </v-col> | ||
| <v-col cols="12" lg="2"> | ||
| <v-btn |
There was a problem hiding this comment.
5 search columns didn't work out as nicely in in the grid layout as 4 columns did. I made some updates to maximize available space for the fields but there's not too much more I can do without writing custom code.
Edit: I've got a fix using auto-layout for the search fields and lg and above. This allows them to use all the space not utilized by the button.
There was a problem hiding this comment.
Reverted to original design to avoid using possibly non-standard syntax.
|
Great work with good amount of test coverage. Only minor comments. |
|
dheepak-aot
left a comment
There was a problem hiding this comment.
Thanks for making the changes. Looks good 👍





Overview
lower(email)to support case-insensitive searching.Screenshots
Ministry
Institution
E2E Tests
Migration Rollback