Repository navigation
A/tl 09 consent enrollment - #32
Merged
Merged
Conversation
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]>
Adds `skipAgentContact()` (resident session only) and a private `agent_decline` table. A skip records the decline and creates no lead; a retry is a no-op; skipping after opting in is a conflict. After a skip, `requestAgentContact` returns "conflict: the resident skipped. Nothing was saved." so a late or stray request can never become a lead. Skips never change `agentOptIns`. New resident view `my_agent_decline` lets the screen show "Skipped" after a reload. This matches D's fixture rule in b09e11a. check:tl09 now covers: skip creates no lead (and a retry adds nothing), request after skip is that conflict with the opt-in count unchanged, skip after opt-in is a conflict, and a session without a role cannot skip. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 8, 2026
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.
Part of #9 (A side; D's screens merged in #24).
Adds private profile, agent_contact and agent_decline tables.
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, including on a trial merge with main 54a29f0.
Status: live locally; Maincloud needs a republish (new tables). Enrollment requires the household's resident invite (no public signup).
Next: D swaps the fixture's requestAgentContact, Skip and registration calls for these reducers and views. D's form also collects name, age and phone, which the server doesn't store.
🤖 Generated with Claude Code