Skip to content

feat(strr-api): new api for examiner notes feature to post and retrieve notes#1691

Open
jimmypalelil wants to merge 4 commits into
bcgov:mainfrom
jimmypalelil:1687-examiner-notes-api
Open

feat(strr-api): new api for examiner notes feature to post and retrieve notes#1691
jimmypalelil wants to merge 4 commits into
bcgov:mainfrom
jimmypalelil:1687-examiner-notes-api

Conversation

@jimmypalelil
Copy link
Copy Markdown
Collaborator

@jimmypalelil jimmypalelil commented Jun 2, 2026

Issue

Description of changes

Implements a new examiner notes API feature that allows STRR staff (examiners and investigators) to create and retrieve internal notes on applications and registrations for audit trail and collaboration purposes.

New Endpoints

  • GET /applications/{application_number}/notes - List notes for an application
  • POST /applications/{application_number}/notes - Create note on application
  • GET /registrations/{registration_id}/notes - List notes for a registration
  • POST /registrations/{registration_id}/notes - Create note on registration

All endpoints require either STRR_EXAMINER or STRR_INVESTIGATOR role.

Confirmed with @pasherwo that both should have the abiltiy to create an list notes.

Business Rules

  • Application notes blocked on certain statuses (DRAFT, PAYMENT_DUE, PAID, AUTO_APPROVED, PROVISIONALLY_APPROVED, FULL_REVIEW_APPROVED, ADDITIONAL_INFO_REQUESTED)
  • Application notes blocked if application is linked to a registration (initial application is already approved and has a registration)
  • Registration notes have no status restrictions
  • Note body required (1-4000 characters after trimming)
  • Notes listed newest first, maximum 500 per list (with truncation indicator)

Database Changes

  • Migration: 20260529_1200_c9e8f7a6b5d4_examiner_notes.py
  • New Table: examiner_notes with:
    • Foreign keys to applications/registrations (one required via CHECK constraint)
    • Author tracking via users table
    • Optimized partial indexes for application_id and registration_id queries

@jimmypalelil jimmypalelil force-pushed the 1687-examiner-notes-api branch 4 times, most recently from 3b84dc6 to 0eb8578 Compare June 2, 2026 18:02
@jimmypalelil jimmypalelil marked this pull request as ready for review June 2, 2026 18:03

logger = logging.getLogger(__name__)

NOTE_LIST_MAX = 500
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.

confirmed with @pasherwo about not wanting pagination on this api and restrict the list count to just the latest 500

@swag_from({"security": [{"Bearer": []}]})
@cross_origin(origin="*")
@jwt.requires_auth
@jwt.has_one_of_roles([Role.STRR_EXAMINER.value, Role.STRR_INVESTIGATOR.value])
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.

confirmed with @pasherwo that both examiners and investigators could create and view notes

Comment thread strr-api/src/strr_api/services/examiner_note_service.py Outdated
@jimmypalelil jimmypalelil requested a review from dimak1 June 2, 2026 19:20
@jimmypalelil jimmypalelil requested a review from JazzarKarim June 2, 2026 20:23
Comment thread strr-api/src/strr_api/services/examiner_note_service.py
Copy link
Copy Markdown
Collaborator

@JazzarKarim JazzarKarim left a comment

Choose a reason for hiding this comment

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

Aside from that one comment, I think it looks good! Great stuff Jimmy.

Please if possible, wait for Dima's approval as well before merging. Thanks!

Comment thread strr-api/src/strr_api/resources/registrations.py
Comment thread strr-api/src/strr_api/enums/enum.py Outdated
Comment thread strr-api/src/strr_api/services/examiner_note_service.py
Comment thread strr-api/src/strr_api/services/examiner_note_service.py Outdated
@jimmypalelil jimmypalelil force-pushed the 1687-examiner-notes-api branch from 3c7fd54 to 7948027 Compare June 2, 2026 22:21
@jimmypalelil jimmypalelil requested a review from dimak1 June 2, 2026 22:22
@jimmypalelil jimmypalelil force-pushed the 1687-examiner-notes-api branch from 7948027 to 3775cc2 Compare June 4, 2026 20:46
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants