Skip to content

#3272 - Add Email to Student Search#5663

Merged
weskubo-cgi merged 9 commits intomainfrom
feature/#3272-student-search-by-email
Jan 27, 2026
Merged

#3272 - Add Email to Student Search#5663
weskubo-cgi merged 9 commits intomainfrom
feature/#3272-student-search-by-email

Conversation

@weskubo-cgi
Copy link
Collaborator

@weskubo-cgi weskubo-cgi commented Jan 23, 2026

Overview

  • Added Email address search to Student Search (Ministry and Institution).
  • Minor layout update to maximize space available for search fields
  • Email is trimmed in web. Also added trim to existing search fields for consistent behaviour.
  • Added index on lower(email) to support case-insensitive searching.
  • Added E2E tests for email field and for failed validation scenario.

Screenshots

Ministry

image

Institution

image

E2E Tests

image image

Migration Rollback

image

@weskubo-cgi weskubo-cgi marked this pull request as draft January 23, 2026 18:22
@weskubo-cgi weskubo-cgi marked this pull request as ready for review January 23, 2026 22:42
@weskubo-cgi weskubo-cgi requested a review from Copilot January 23, 2026 22:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 SearchStudents component 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.

Copy link
Collaborator

@tiago-graf tiago-graf left a comment

Choose a reason for hiding this comment

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

Looks great

firstName: "",
lastName: "",
sin: "",
email: "StUdEnT@hOtMaIl.cOm",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This made me chuckle

@dheepak-aot dheepak-aot added SIMS-Api SIMS-Api DB DB migration involved Web portal labels Jan 26, 2026
@dheepak-aot dheepak-aot self-requested a review January 26, 2026 21:53
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";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a benefit manually updating the email here? I see that the updated value isn't used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

/>
</v-col>
<v-col cols="12" lg="2">
<v-btn
Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed that due to full-with the button is not at the end when comparing with existing view. But I don't expect any fix for that.

Image Image

Copy link
Collaborator Author

@weskubo-cgi weskubo-cgi Jan 27, 2026

Choose a reason for hiding this comment

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

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.

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.

Reverted to original design to avoid using possibly non-standard syntax.

@dheepak-aot
Copy link
Collaborator

Great work with good amount of test coverage. Only minor comments.

@sonarqubecloud
Copy link

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.18% ( 4321 / 21410 )
Methods: 9.69% ( 253 / 2611 )
Lines: 24.35% ( 3710 / 15237 )
Branches: 10.05% ( 358 / 3562 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 75.41% ( 1055 / 1399 )
Methods: 79.31% ( 115 / 145 )
Lines: 78.79% ( 769 / 976 )
Branches: 61.51% ( 171 / 278 )

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 👍

@weskubo-cgi weskubo-cgi added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit e954657 Jan 27, 2026
20 checks passed
@weskubo-cgi weskubo-cgi deleted the feature/#3272-student-search-by-email branch January 27, 2026 20:28
@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 85.68% ( 1616 / 1886 )
Methods: 85% ( 187 / 220 )
Lines: 88.64% ( 1287 / 1452 )
Branches: 66.36% ( 142 / 214 )

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 77.2% ( 8827 / 11434 )
Methods: 76.66% ( 1041 / 1358 )
Lines: 81.24% ( 6408 / 7888 )
Branches: 62.98% ( 1378 / 2188 )

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 Web portal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants