Skip to content

Conversation

@bidyashish
Copy link
Contributor

@bidyashish bidyashish commented Jul 4, 2025

Update search for parent only

Demo
image

Error
image

E2E test will follow.

@bidyashish bidyashish self-assigned this Jul 4, 2025
@bidyashish bidyashish changed the title #4818 - Parent Declare - Supporting User Portal Update #4818 - Parent Declare - Supporting User Portal Update - Part 1 Jul 4, 2025
@bidyashish bidyashish marked this pull request as draft July 4, 2025 18:02
@bidyashish bidyashish marked this pull request as ready for review July 7, 2025 16:27
@bidyashish bidyashish requested a review from Copilot July 7, 2025 18:32
@dheepak-aot dheepak-aot requested review from dheepak-aot and removed request for Copilot July 7, 2025 18:33
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

This PR adds support for Parent searches alongside Partner searches by introducing a full-name field, updating DTOs, and refactoring backend logic into a unified service method.

  • Added “Parent’s full name” input in the UI and adjusted validation/labels
  • Extended DTOs with optional parentFullName and made studentsDateOfBirth optional
  • Refactored backend controllers to use a new getSupportingUserForApplication method and removed the old one

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sources/packages/web/src/views/supporting-user/SupportingInformation.vue UI: added Parent full name field, updated labels and form logic
sources/packages/web/src/services/http/dto/SupportingUser.dto.ts Added parentFullName? and made studentsDateOfBirth? optional
sources/packages/backend/apps/api/src/services/supporting-user/supporting-user.service.ts New getSupportingUserForApplication method, unified filtering
sources/packages/backend/apps/api/src/services/application/application.service.ts Removed deprecated getApplicationForSupportingUser
sources/packages/backend/apps/api/src/route-controllers/supporting-user/...supporting-users.controller.ts Updated controllers to call the new service method
sources/packages/backend/apps/api/src/route-controllers/supporting-user/models/supporting-user.dto.ts Added optional fields to the API input DTO, adjusted validation
Comments suppressed due to low confidence (4)

sources/packages/web/src/views/supporting-user/SupportingInformation.vue:24

  • The label passed to checkOnlyDigitsRule still reads 'Number' while the null/empty rule uses 'Application number'. Update this to 'Application number' for consistency.
                (v) => checkOnlyDigitsRule(v, 'Number'),

sources/packages/backend/apps/api/src/route-controllers/supporting-user/models/supporting-user.dto.ts:39

  • The studentsDateOfBirth field is optional but has no format validation. Consider adding a decorator like @IsISO8601() or @IsDateString() to enforce a valid date format.
  studentsDateOfBirth?: string;

sources/packages/backend/apps/api/src/services/supporting-user/supporting-user.service.ts:277

  • The new getSupportingUserForApplication method implements critical filtering logic for both Parent and Partner flows but lacks unit tests. Add tests covering both branches (with parentFullName and with studentsDateOfBirth).
  async getSupportingUserForApplication(

sources/packages/web/src/views/supporting-user/SupportingInformation.vue:361

  • The supportingUserType prop is used in the template (v-if="supportingUserType === ...") but isn't exposed in the return of setup. Add supportingUserType: props.supportingUserType to the returned object.
    };

<v-text-field
density="compact"
label="Student's date of birth"
label="Parent's full name"
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

Thanks for making the changes @bidyashish. Added some more comments.

Comment on lines 38 to 41
@ValidateIf(
(object: UpdateSupportingUserAPIInDTO) =>
object.supportingUserType === SupportingUserType.Parent,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry about the confusion, the object must be typed with the DTO type, which in this case and on line 49 as well is ApplicationIdentifierAPIInDTO

@ValidateIf(
    (object: ApplicationIdentifierAPIInDTO) =>
      object.supportingUserType === SupportingUserType.Parent,
  )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

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 @bidyashish. Left one last comment on class validator.

Copy link
Collaborator

@sh16011993 sh16011993 left a comment

Choose a reason for hiding this comment

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

Nice work @bidyashish 👍

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2025

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 21.67% ( 4097 / 18905 )
Methods: 9.68% ( 234 / 2418 )
Lines: 25.02% ( 3544 / 14166 )
Branches: 13.74% ( 319 / 2321 )

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 72.94% ( 717 / 983 )
Methods: 73.5% ( 86 / 117 )
Lines: 74.97% ( 563 / 751 )
Branches: 59.13% ( 68 / 115 )

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 86.42% ( 1547 / 1790 )
Methods: 84.62% ( 176 / 208 )
Lines: 88.74% ( 1277 / 1439 )
Branches: 65.73% ( 94 / 143 )

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

E2E SIMS API Coverage Report

Totals Coverage
Statements: 73.22% ( 7201 / 9835 )
Methods: 70.83% ( 884 / 1248 )
Lines: 76.63% ( 5581 / 7283 )
Branches: 56.44% ( 736 / 1304 )

@bidyashish bidyashish added this pull request to the merge queue Jul 9, 2025
Merged via the queue into main with commit 517cfd1 Jul 9, 2025
22 checks passed
@bidyashish bidyashish deleted the feature/4818-supporting-user-2 branch July 9, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants