From 1c8997bd4f26e13fbd1877a5d8b86d29c001dec9 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 20 Mar 2026 19:16:43 -0400 Subject: [PATCH] =?UTF-8?q?docs:=20update=20Exhibitor=20Leads=20module=20d?= =?UTF-8?q?oc=20=E2=80=94=20confirm=20modes,=20re-enable,=20capture=20iden?= =?UTF-8?q?tity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../MODULE__AE_Events_Exhibitor_Leads.md | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/documentation/MODULE__AE_Events_Exhibitor_Leads.md b/documentation/MODULE__AE_Events_Exhibitor_Leads.md index e61df54d..73888d4c 100644 --- a/documentation/MODULE__AE_Events_Exhibitor_Leads.md +++ b/documentation/MODULE__AE_Events_Exhibitor_Leads.md @@ -80,11 +80,13 @@ The only tab visible when not signed in as a licensed leads user. Visible only when signed in (licensed user or Aether auth). - **Text search** — search by name, email, affiliations, badge ID -- **QR scan** — two modes: - - **Rapid** — auto-resets after 2 seconds for the next scan (high volume) - - **Qualify** — navigates immediately to lead detail to capture notes per scan +- **QR scan** — three modes (persisted per exhibit in `tab_scan_qualify`): + - **Confirm** (`rapid`) — scan, then choose per badge: **Add & Scan Next** (resets after 2s) or **Add & View Lead** (navigates to detail) + - **Auto** — no confirmation tap; adds immediately and auto-resets (high-throughput) + - **Multi** — BarcodeDetector batch scan; up to 4 badges in one frame as a confirm grid +- Previously-removed leads detected on scan — shown a "Previously Removed" card with **Restore & Scan Next** / **Restore & View Lead** buttons - Results show "Add as Lead" or "View Lead" depending on whether already captured -- All new leads are linked to the capturing user's email (`external_person_id`) +- `external_person_id` and `group` resolved by auth type — see [Capture Identity](#capture-identity) below ### Tab 3 — Leads List @@ -210,6 +212,31 @@ Both aggregated into `events_func` via `src/lib/ae_events/ae_events_functions.ts --- +## Capture Identity + +`external_person_id` and `group` on every `event_exhibit_tracking` record record who captured the lead. Resolved at capture time in all three lead capture components (single scanner, multi scanner, manual search): + +| Auth type | `kv.type` | Value stored | +| --- | --- | --- | +| Licensed exhibit user | `'licensed'` | Their email address (`kv.key`) | +| Shared exhibit passcode | `'shared'` | `'shared_passcode'` (label — raw passcode is NOT stored) | +| Aether user (admin bypass, no kv) | `undefined` | `$ae_loc.access_type` — e.g. `'trusted'`, `'manager'`, `'super'` | + +`kv` = `$events_loc.leads.auth_exhibit_kv[exhibit_id]` (localStorage-persisted exhibit sign-in state). + +--- + +## Lead Soft-Delete / Re-enable + +Leads are never hard-deleted. "Remove Lead" sets `enable = false`. Key behaviors: + +- **Leads list** always filters out `enable = false` records (both IDB fast-path and API results) — no flash of removed records +- **QR scanner**: if a previously-removed badge is scanned, the scanner detects it via `existing_leads_map` (IDB) or API fallback search (`search__exhibit_tracking` with `qry_badge_id` + `enabled: 'not_enabled'`) and shows the reenable card instead of an error +- **Lead detail page**: "Remove Lead" button (two-click confirm in header) sets `enable = false` and navigates back. "Restore Lead" card appears at the bottom of the right sidebar when `enable` is falsy. +- `search__exhibit_tracking` supports `qry_badge_id` param (added) and `enabled: 'not_enabled'` to find disabled records for a specific badge + exhibit combination + +--- + ## Known Gaps ### Payment / Stripe