feat(cases/notes): implement investigation notes system (#127) - #177
Merged
mijinummi merged 3 commits intoJun 21, 2026
Merged
Conversation
…Production#127) - Add NotesService with create/read/update/soft-delete and audit trail - Add NotesController with REST endpoints under /cases/:caseId/notes - Add NotesModule and register it in AppModule - Add InvestigationNote and NoteAuditLog Prisma models (schema.prisma) - Add barrel index.ts for clean imports - Add unit tests for NotesService and NotesController Closes MD-Creative-Production#127
…ude path and remove type casts - Move src/modules/cases/notes/ → apps/backend/src/modules/cases/notes/ so files are covered by tsconfig.json include: ["apps/backend/**/*"] - Fix import path in app.module.ts: use relative ./modules/cases/notes instead of broken ../../../src/modules/cases/notes path - Replace (prisma.auditLog as any).update() casts with properly typed prisma.auditLog.update() calls (no any cast needed) - Clean up spec: replace mid-test mock re-assignments with mockResolvedValue
Collaborator
|
Hello @amankoli09 , kindly fix and run lint, typescript check, update your branch and push again. Thank you for your contribution. |
…-Production#127) - tsconfig: add explicit "types": ["node", "jest"] so ambient node/jest globals resolve under TS 6 (fixes repo-wide "Cannot find name 'jest'/'process'" type-check errors) - notes: apply prettier formatting and drop unused PrismaClient import to satisfy eslint No behavior change; all backend tests (119) pass, build is green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
LGTM |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #127
🧠 Summary
Implements the Investigation Notes System as specified issue
Allows security teams to record, edit, and track investigation findings
per case with a full immutable audit history.
✅ Changes
New:
src/modules/cases/notes/NotesService— CRUD + soft-delete + per-note audit trail usingPrismaClient.ForbiddenExceptionotherwise).created|updated|deleted).NotesController— 5 REST endpoints scoped to/cases/:caseId/notes, including a dedicated/historyroute.NotesModule— NestJS module; exportsNotesServicefor consumption by other modules.note.interface.ts— Full TypeScript interface definitions (CreateNoteDto,UpdateNoteDto,NoteAuditEntry,InvestigationNote).notes.service.spec.ts(15 cases) +notes.controller.spec.ts(6 cases).Modified:
prisma/schema.prismaInvestigationNotemodel withcaseIdindex, soft-delete fields, and tags array.NoteAuditLogmodel withnoteIdindex for migration-ready dedicated audit storage.Modified:
apps/backend/src/app.module.tsNotesModuleso endpoints are live on app startup.🎯 Acceptance Criteria
NoteAuditLogaudit entries on every write)ForbiddenExceptionenforced)🔗 Closes #127