Therapy note authorship is never recorded (submitterId unused + Int/String mismatch)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- authentication, backend-api-design, databases, full-stack
Research direction
Read prisma/schema.prisma alongside server/api/session/notes/index.post.ts and server/api/session/notes/[id].put.ts, then inspect composables/therapy/useTherapyNoteForm.ts and the note-reading views. Verify the authenticated user is the sole source of the author, the schema and migration represent a User reference, and author information is viewable where notes are read.
Written by the indexing model from the issue text.
Description
Part of #285 (Group C — notes correctness).
Problem
For a clinical PHI record, "who wrote this note" is never recorded, and the field meant to hold it is the wrong type.
Evidence
server/api/session/notes/index.post.tssetssubmitterIdfrom the request body (data.submitterID ?? data.submitterId ?? null), not fromevent.context.user. The client never sends it —composables/therapy/useTherapyNoteForm.tsbuilds the payload with nosubmitterIdkey — so it is always null.- Type mismatch:
TherapyNote.submitterIdisInt?(prisma/schema.prisma:260) butUser.idis aStringuuid (prisma/schema.prisma:11). No FK relation is declared, and the Zod schema types itz.number().int(). A uuid can't be stored even if sent. server/api/session/notes/[id].put.tsnever touchessubmitterId.
Impact
P1 (data integrity / PHI). Notes have no author. The column is structurally unusable as a User reference.
Proposed approach
- Change
submitterIdtoStringwith a proper FK relation toUser(migration). - Set
submitterId = event.context.user.idserver-side on create (ignore any client value). - Optionally display the author in
NotesHistory/ViewNoteModal.
Acceptance criteria
- Every new note records the authenticated author server-side.
-
submitterIdis aStringFK toUser(or an explicit relation). - Author is viewable where notes are read.
- Dominant language
- Vue
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from UTDallasEPICS/connected-care
-
area: auth enhancement P2: medium security
Difficulty 5/5 Over a week Newbie friendliness 35/100
UTDallasEPICS/connected-care#309 ·
-
area: auth enhancement P1: high security
Difficulty 5/5 Over a week Newbie friendliness 25/100
UTDallasEPICS/connected-care#308 ·
-
area: auth enhancement P1: high security
Difficulty 5/5 Over a week Newbie friendliness 38/100
UTDallasEPICS/connected-care#307 ·
-
area: auth enhancement P1: high security
Difficulty 5/5 Over a week Newbie friendliness 25/100
UTDallasEPICS/connected-care#306 ·
-
area: patient area: schedule enhancement P2: medium
Difficulty 5/5 Over a week Newbie friendliness 35/100
UTDallasEPICS/connected-care#305 ·
All issues in UTDallasEPICS/connected-care
Similar issues
-
good first issue size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
fells-code/seamless-glance#136 ·
Maintainers usually reply within 1 day
-
external-issue to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
bip322.sign takes no WIF, where bms.sign doesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#733 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
arkavo-org/ArkavoKit#70 ·
Maintainers usually reply within 1 day