Repository navigation
TL-09: preparedness profile and voluntary agent contact (fixture) - #24
Merged
Merged
Conversation
Owner
Author
|
Fixed the P2 race in b09e11a:
Checked in the browser: Ask, navigate away and back gives L-1 with no Skip button left. Skip, then a request, gives a conflict and opt-ins stay 0. Opt-in, then a retry, gives a duplicate. |
gholapksh
pushed a commit
that referenced
this pull request
Nov 8, 2026
Part of #9 (A side; D's screens are PR #24). Adds two private tables: `profile` (one free preparedness profile per household: medical need, backup device, address, preferred contact) and `agent_contact` (at most one consented lead per household). - `enrollPreparedness(enrollmentId, medicalNeed, backupDevice, address, preferredContact)`: resident session only; a retry is a no-op; a second profile for the household is a conflict. - `requestAgentContact(consentId)`: resident session only; offered only after that household has a delivered job; a retried consentId is a no-op; a second consentId is a conflict. Skip is client-side and creates nothing. - Views: `my_profile`, `my_agent_request` (resident receipt), `coordinator_profiles`, and `coordinator_registry_stats` with registrations and agent opt-ins counted separately. Coordinators never see the leads. Dispatch never reads profiles or leads. Proof: `npm ci && npm --prefix spacetimedb ci && spacetime start`, then `npm run stdb:reset:local && npm run check:tl09`; expect `PASS: TL-09 enrollment and agent contact`. TL-01, TL-05 and TL-06 still pass. Status: live locally; Maincloud needs a republish (new tables). Enrollment requires the household's resident invite; no public signup. Next: D replaces the fixture `requestAgentContact` and registration in PR #24 with these reducers and views. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
TL-09: preparedness profile and voluntary State Farm agent contact (fixture mode)
Adds the preparedness framing to registration and an optional, consented "ask a State Farm agent about coverage" request that appears only after the resident confirms delivery. It uses the TL-04 fixture store. The live reducer and private consent table come from A.
What a judge sees
Contract
requestAgentContact(consentId)returns committed, duplicate or conflict, as in the shared contract:received, which saves one lead;consentIdretried, with nothing new saved;consentIdonce a lead exists, or any request before delivery.Still fixture: A's reducer and private consent table aren't built yet (
docs/setup.md). TL-07 swaps the store call for the reducer.Acceptance check (run in the browser)
The "both residents get identical assistance" check is shown with one interactive household: run it once opting in, Reset demo, and run it again choosing Skip. Dispatch and delivery are identical in both runs.
How to check
npm ci && npm run dev
Register, then Start outage, reply "30 to 60" on the resident phone, and Reserve on the board. On the driver phone tap Start route and I have arrived, then tap I received the battery on the resident phone. Expected: the agent offer appears. Tick consent and choose Ask an agent: expected receipt L-1, and the board count is 1. Reset, repeat, and choose Skip: nothing saved, count 0.
Notes
frontend/prototype that slipped into the first commit. The net diff is 8 files undersrc/. Please use Squash and merge so those files stay out of main's history.