Skip to content

#5190 - Appeals and forms analysis work - Student Notes#5862

Merged
andrewsignori-aot merged 13 commits intomainfrom
feature/#5190-new-unified-data-path-for-appeals-and-forms-notes
Mar 10, 2026
Merged

#5190 - Appeals and forms analysis work - Student Notes#5862
andrewsignori-aot merged 13 commits intomainfrom
feature/#5190-new-unified-data-path-for-appeals-and-forms-notes

Conversation

@andrewsignori-aot
Copy link
Copy Markdown
Collaborator

@andrewsignori-aot andrewsignori-aot commented Mar 6, 2026

PR Goal

  • "Student appeal" and "Student form" note categories are displayed under a new "Forms" category for the Ministry and Institutions.
  • For listing the notes, Institutions have the same access as the Ministry; no authorization should be applied.
    • The institutions should be able to see notes that belong to other applications, appeals, and forms, even if not their own (student filter applied only).
  • Ministry manual creation of a note should allow the creation of the individual categories "Student appeal" and "Student form". Once added, they will be displayed under the shared "Forms" category.
  • Only users with the specific roles should be able to see the options for manually creating notes for "Student appeal" and "Student form", which means the list of available options will remove note categories that the user does not have access to.
  • No need to toggle this area since there will be no meaningful production impact in having it available ahead of the remaining feature.

UI displaying "Student appeal" and "Student form"

Ministry

image

Institution

image

UI Fixes

  • For a long note entry, the date was breaking into multiple lines, and the "Show more" feature was no longer working, as shown below.
image
  • The "fixed" version would be as shown below. Please note that the "Show more" was already there, just not working properly.
image image
  • The user name is now retrieved from the API, as the other endpoints, resolving the issue for mononyn names.
image

Technical Changes

  • Note-related API endpoints are now supporting multiple categories as a filter. This allows the user to see a category named Forms and filter by Student appeal and Student forms notes.
    • Create a small structure to allow this, and any other similar UI-to-API-note-category-map to be created.
    • NoteService methods on Web are still accepting one StudentNoteType or InstitutionNoteType. Please note that the Web deals with the institution vs students' notes using different enums, which are subsets of the backend notes.
  • enum NoteType was added to the Web.
  • NoteAPIOutDTO is now in sync between Web and API.

E2E Tests

  • New E2E test added to retrieve two categories:
    • Should get two student notes from two different categories when the two categories are provided as a filter.
  • Note-related get E2E tests refactored to bring the patterns closer to the most updated ones.
  • New E2E tests to test the proper authorization for the categories.
    • Should create a note for category Student appeal when the user has authorization for this note type.
    • Should create a note for category Student form when the user has authorization for this note type.
    • Should throw forbidden error when trying to create a Student appeal but the user does not have authorization for this note type.
    • Should throw forbidden error when trying to create a Student form but the user does not have authorization for this note type.

@andrewsignori-aot andrewsignori-aot self-assigned this Mar 6, 2026
@andrewsignori-aot andrewsignori-aot added Ministry Ministry Features SIMS-Api SIMS-Api Web portal labels Mar 6, 2026

This comment was marked as outdated.

Copy link
Copy Markdown
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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.


You can also share your feedback on Copilot code review. Take the survey.

Comment thread sources/packages/web/src/components/common/notes/CreateNoteModal.vue Outdated
Comment thread sources/packages/backend/apps/api/src/services/student/student.service.ts Outdated
@andrewsignori-aot andrewsignori-aot marked this pull request as ready for review March 9, 2026 16:53
* @param note note to be transformed.
* @returns an object item for the notes returned by the API.
*/
export function noteToApiReturn(note: Note) {
Copy link
Copy Markdown
Collaborator

@tiago-graf tiago-graf Mar 9, 2026

Choose a reason for hiding this comment

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

not your code but can we call it transformNoteToApiReturn?

return ApiClient.NoteApi.getStudentNotes(studentId);
}
const convertedNotes = STUDENT_NOTE_TO_NOTES_TYPE_MAP.get(noteType) ?? [
noteType as unknown as NoteType,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clever but confusing conversion, it seems there's no other way to "extend" enums but you could have a export type directly mapping to the enum ->

export type InstitutionNoteType =
| NoteType.General
| NoteType.Restriction
| NoteType.System
| NoteType.Program
| NoteType.Designation;

not sure of the side effects of this tho!

Copy link
Copy Markdown
Collaborator Author

@andrewsignori-aot andrewsignori-aot Mar 9, 2026

Choose a reason for hiding this comment

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

Yeah, I wasn't too happy about it. I tried different approaches, but I tried to avoid losing the iterable part over the InstitutionNoteType that is used in one part of the UI.
I can give a second thought 😉

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Didn`t find any great alternative. I ended up just renaming it a bit and changing the cast as below.

studentNote as string as NoteType

Copy link
Copy Markdown
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.

It looks great just a small comment

@dheepak-aot dheepak-aot self-requested a review March 10, 2026 16:04
*/
export class NoteAPIQueryStringAPIInDTO {
@IsOptional()
@ArrayMaxSize(Object.keys(NoteType).length)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

@Roles(Role.StudentCreateNote)
@ApiNotFoundResponse({ description: "Student not found." })
@ApiForbiddenResponse({
description:
Copy link
Copy Markdown
Collaborator

@dheepak-aot dheepak-aot Mar 10, 2026

Choose a reason for hiding this comment

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

Asking the question if not raised already, for the scope of adding institution notes, there must be consideration of NoteTypes permissible and not permissible to be added.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am not sure if I am following. What would be the case to have institution notes permissions considerations in the context of this feature?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I meant while adding the note for an institution, shouldn't the note types be only w.r.t institutions. ?We have that in UI, but API is not validated.

image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Currently, the DTO is shared between the institution and students. We need to create a specific DTO for each client, do the same on the Web, and create an E2E for each. I do not see it as part of this PR.

Copy link
Copy Markdown
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.

Nice work. Thanks for making the changes. Looks good 👍

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.26% ( 4565 / 22529 )
Methods: 9.56% ( 262 / 2741 )
Lines: 24.58% ( 3917 / 15933 )
Branches: 10.01% ( 386 / 3855 )

@github-actions
Copy link
Copy Markdown

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 75.23% ( 1066 / 1417 )
Methods: 78.38% ( 116 / 148 )
Lines: 78.68% ( 775 / 985 )
Branches: 61.62% ( 175 / 284 )

@github-actions
Copy link
Copy Markdown

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
Copy Markdown

E2E SIMS API Coverage Report

Totals Coverage
Statements: 75.72% ( 9529 / 12584 )
Methods: 73.92% ( 1100 / 1488 )
Lines: 80.33% ( 6912 / 8605 )
Branches: 60.9% ( 1517 / 2491 )

@andrewsignori-aot andrewsignori-aot added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit eb655ab Mar 10, 2026
22 checks passed
@andrewsignori-aot andrewsignori-aot deleted the feature/#5190-new-unified-data-path-for-appeals-and-forms-notes branch March 10, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ministry Ministry Features SIMS-Api SIMS-Api Web portal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants