Repository navigation
# [FEAT] Design Independent Forensic Investigation & Case Management Domain Model in Prisma #126
Copy link
Copy link
Closed
Labels
GrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignCampaign: Third Campaign
Description
Labels: enhancement, database, prisma, architecture, security-ops
Difficulty: High
Module: prisma/schema.prisma
🧠 Concept
Architect and integrate a dedicated, independent Investigation & Case Management data model within the system's core database domain (prisma/schema.prisma). The model must decouple long-running forensic case tracking from transient, short-lived alert incidents while supporting multi-party investigation ownership, granular audit trail history, and dynamic relationships to associated system evidence.
⚠️ Problem
Coupling forensic case tracking directly to incident alert records introduces significant operational and data integrity issues:
- 1:1 Incident Limitations: Single security incidents often fan out into complex, multi-week investigations spanning multiple distinct systems and sub-incidents.
- Missing Forensic Provenance: Closing or re-opening a temporary incident ticket corrupts or resets evidence chains, hindering long-term regulatory compliance and post-mortem reporting.
- Inflexible RBAC & Ownership: Incident responders, external threat intelligence partners, and legal audit teams require distinct access levels across active cases that cannot be safely mapped to generic incident responder roles.
📁 Implementation Scope
prisma/schema.prismaprisma/migrations/src/domain/cases/types/src/infrastructure/database/seeds/caseSeed.ts
🛠️ Requirements
1. Database Schema Extensions (prisma/schema.prisma)
Define a robust data model with strict relational constraints:
CaseModel:- Primary identifiers (
idUUIDv4, human-readable identifiercaseNumberindexed, e.g.,CASE-2026-0891). - Enums for state lifecycle (
CaseStatus:DRAFT,ACTIVE,IN_REVIEW,SUSPENDED,CLOSED,ARCHIVED) and severity level (CaseSeverity:LOW,MEDIUM,HIGH,CRITICAL). - Timestamps for record lifecycle (
createdAt,updatedAt,closedAt,nextReviewAt).
- Primary identifiers (
- Ownership & Access Control Models:
- Support lead investigator designation (
leadInvestigatorIdreferencingUser). CaseAssigneejoin table for multi-user collaborator tracking with granular role attributes (INVESTIGATOR,LEGAL_OBSERVER,EXTERNAL_AUDITOR).
- Support lead investigator designation (
- Incident & Artifact Relational Mapping:
- Many-to-Many (
M:N) explicit mapping table (CaseIncident) linking multipleIncidentrecords to a singleCase. - Cascading delete/nullify behavior (
onDelete: Restrict) on critical case history to prevent accidental data loss during incident cleanup.
- Many-to-Many (
- Audit & Timeline Ledger:
CaseActivityLogmodel capturing state mutations, actor ID, IP address, changed fields (JSON diffs), and timestamp for tamper-evident history.
2. Migration & Seed Pipeline
- Generate a deterministic, production-ready SQL migration (
prisma migrate dev). - Build a comprehensive database seed script populating mock cases, multi-incident attachments, and history logs for local integration testing.
🎯 Acceptance Criteria
- Schema Validation:
prisma validateexecutes cleanly with zero syntax errors or implicit relation ambiguity warnings. - Migration Safety: Migration applies seamlessly against a populated database without destructive table rewrites or lockup risks.
- Referential Integrity:
CaseIncidentandCaseActivityLogrelations enforce strict foreign key constraints; attempts to delete an activeCasecontaining locked forensic records revert gracefully. - Audit Trail Completeness: Model schema inherently supports capturing delta diffs on every status transition without relying on application-level memory state.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
GrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignCampaign: Third Campaign
Activity
Hassanjubril18 commentedon Jun 15, 2026
Please I would like to work on this issue
codesailor4 commentedon Jun 21, 2026
https://contribute.grantfox.xyz/org/sharif-stellar-tools/repo/stellar-wallet-helper/issue/57
grantfox-oss commentedon Jun 21, 2026
🦊 GrantFox — @codesailor4 has been assigned to this issue as part of the Official Campaign campaign!
Next steps:
Closes #126)Good luck! Track your progress on GrantFox.
[-]Create Security Case Management Entity[/-][+]# [FEAT] Design Independent Forensic Investigation & Case Management Domain Model in Prisma #652[/+][-]# [FEAT] Design Independent Forensic Investigation & Case Management Domain Model in Prisma #652[/-][+]# [FEAT] Design Independent Forensic Investigation & Case Management Domain Model in Prisma[/+]SharifIbrahimDev commentedon Aug 24, 2026
Hello maintainer Please I would like to work on this issue
grantfox-oss commentedon Aug 24, 2026
🦊 GrantFox — @SharifIbrahimDev has been assigned to this issue as part of the Third Campaign campaign!
Next steps:
Closes #126)Good luck! Track your progress on GrantFox.
feat(cases): add forensic investigation and case domain model (#126)
grantfox-oss commentedon Aug 27, 2026
🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!
@SharifIbrahimDev's PR #226 was approved and merged by @mijinummi.
🏆 @SharifIbrahimDev: You earned 40 FoxPoints for this contribution! Your current tier: Builder (2,540 total points). Track your full progress on GrantFox.
👏 Great work, @SharifIbrahimDev! Keep contributing to MD-Creative-Production.