Use existing 'Primary Contact' relationship type via FORM_CONTACT_RELATIONSHIP constant

This commit is contained in:
Joel Brock
2026-05-09 20:57:29 -07:00
parent e132789a3e
commit 2e9d3855ba
5 changed files with 46 additions and 54 deletions

View File

@@ -18,7 +18,7 @@ https://check-in.fci.coop/?cid=<contactId>&cs=<checksum>
The app:
1. Verifies the checksum against CiviCRM.
2. Resolves the org from the contact's **Primary Form Contact** relationship.
2. Resolves the org from the contact's **Primary Contact** relationship (Individual → Organization). Configurable via `FORM_CONTACT_RELATIONSHIP` in `config/form.ts`.
3. Reads the org's **Framework Stage** (`Food_Co_op_Organizing.Stage`) — text-keyed values like `Inquiry`, `Organizing`, `Feasibility`, `Business feasibility`, `Store Implementation`, `Stabilize newly opened co-op`.
4. Walks the org's past `Org Engagement Submission` activities DESC and assembles per-field-most-recent prefill values (the exact behaviour the WCM admin UI cannot express).
5. Renders the form with stage-conditional sections — Stage 0 (Inquiry / core check-in fields, ~32 of them) is always visible; Stages 15 each appear when `current_stage` is in their visibility set.