feat(sse): scope timeline events to affected audiences
This commit is contained in:
@@ -113,6 +113,15 @@ Routes in [timeline.ts](/home/hartmut/Documents/Copilot/capakraken/packages/api/
|
||||
| `getShiftPreviewDetail` | `controllerProcedure` | detail variant includes project metadata plus cost/conflict preview |
|
||||
| `getBudgetStatus` | `controllerProcedure` | budget burn/remaining exposure is commercial data |
|
||||
|
||||
### Timeline SSE
|
||||
|
||||
The live-update path in [event-bus.ts](/home/hartmut/Documents/Copilot/capakraken/packages/api/src/sse/event-bus.ts) and [route.ts](/home/hartmut/Documents/Copilot/capakraken/apps/web/src/app/api/sse/timeline/route.ts) now follows the same audience model as the timeline reads:
|
||||
|
||||
- planning staff subscribe through role/permission audiences
|
||||
- linked users additionally subscribe to their own `resource:<id>` audience
|
||||
- allocation, vacation, and project-shift events fan out to both staff planning audiences and the affected resource audiences
|
||||
- self-service timeline clients invalidate both personal entries and personal holiday overlays on allocation and vacation events
|
||||
|
||||
## Review Standard
|
||||
|
||||
- Any new sensitive read route must document one of:
|
||||
|
||||
Reference in New Issue
Block a user