Split groups — flow from trigger
How Nowhere detects a split group booking, stores a staff feed item, and (in #372 Phase A) clears stale cards when the feed loads.
End-to-end
flowchart TD
A[Acuity webhook action=rescheduled] --> D[detectPartialRescheduleForEmail]
B[Staff drawer PUT action=reschedule] --> D
D --> Q{Same-email group split across times?}
Q -->|no| N[No feed item]
Q -->|yes| S[Upsert pending notification
unified_notifications]
S --> L[Staff opens Split groups
GET /api/notifications]
L --> R[Reconcile vs D1 acuity_appointments_raw]
R --> K{Still actionable?}
K -->|no| X[Drop from store
empty feed]
K -->|yes| C[Show card with date+time]
C --> F[Move leftovers if target future
or dismiss]
Trigger / new Webhook or drawer start; reconcile is new in #372.
Keep in feed Real future split with a future target.
Drop Aligned, past, canceled, or past target.
Done Nothing to show, or leftovers moved.
What “stale” means on load
flowchart TD
N[Pending partial_reschedule] --> D1[Load group from D1 cache]
D1 --> R{Drop?}
R -->|aligned| X[Remove]
R -->|all past| X
R -->|past target| X
R -->|canceled / gone| X
R -->|else| K[Keep: future split + future target]
Notes
- Auto-fix stays off in production. Detection still writes a pending feed item; it does not move appointments or stamp Acuity notes until Fix / auto-fix.
- Preview and production share D1, so the first reconcile on either environment clears the shared store.
- Drawer reschedule of one appointment is unchanged. Phase B would ask “also move the rest?” there.