Problem & approach
Requesters and support agents need a shared view of an incident, but they should not have the same permissions. Simultaneous changes must not silently overwrite assignments, status or resolution history.
I built a guarded incident workflow with server-issued sessions, organization/team/resource scope, manual assignment and version-aware mutations. The requester confirms resolution; the API enforces transitions independently of the interface.
- 01
Submit
A signed-in requester creates a scoped ticket.
- 02
Handle
Support assigns, comments and moves through allowed states.
- 03
Confirm
The requester confirms resolution; events retain the history.
Inside the application
- RequestCreate an incident or service request and inspect authorized tickets.
- CoordinateAssign an agent manually and separate public comments from internal notes.
- TraceReview persisted lifecycle and assignment history with version-conflict handling.
System architecture
React + TypeScript
Authenticated queue, ticket controls and account/team management.
NestJS modules
Sessions, resource scope, lifecycle guards and expected-version checks.
Prisma → PostgreSQL
Ticket, history and outbox writes share a transaction. No delivery worker yet.
- TypeScript
- React
- NestJS
- Prisma
- PostgreSQL
Engineering decisions
The API owns permissions
I enforce requester, team and organization scope on the server. Hiding a control is useful guidance, but cannot stop someone from issuing a direct request.
Reviewed: Session guards and ticket resource scope
Commit history with the change
Ticket updates, their audit trail and outbox records commit together. The outbox prepares for future recoverable processing; without a worker it is not an automation system.
Reviewed: Transactional ticket mutations
Implementation in focus
Two agents changing the same ticket
- Problem
- A stale interface can submit an action after another agent has changed the record.
- Implementation
- Mutations check an expected version and reject conflicting writes. Lifecycle rules and assignment constraints protect the database even when the browser is stale.
Verification & status
API, database & browser test records
Repository status · 18 November 2026 · Audit gate unresolved
The repository records 10 unit/HTTP, 19 PostgreSQL integration and 24 Chromium tests. Checks include permissions, lifecycle conflicts, assignment consistency and browser workflows.
Reviewed historical results, not a new execution. The recorded hosted pipeline passed those checks but failed its dependency-audit gate; the overall pipeline was not green.
Incident workflow implemented
The first authenticated incident slice works locally. The broader fictional interface preview remains separate from the persisted workflow.
No production deployment. Automated assignment, worker recovery, measured SLA reports, account recovery and the unified interface remain unfinished.
Lessons & next steps
A durable record and a delivered action are different guarantees. I keep that boundary explicit rather than presenting stored outbox events as completed automation.
Resolve dependency advisories, integrate the authenticated UI and implement recoverable workers with failure-path tests.
Source & evidence access
The repository remains private. This case study shares reviewed implementation summaries and safe application captures, not source code or operational records.
Private source snapshot 5195969, inspected 18 November 2026. Preview captures are explicitly labeled; no real tickets or private accounts are published.


