Implements OpenSpec change add-event-lead-capture: interests, and capturing leads at events from a phone.
Database (service-counter): lead, event_lead, interest and event_lead_interest tables, plus the BO_EVENT_LEADS and BO_INTERESTS modules. The SQL is in the change folder and mirrored in local/seed/03-colite.sql.
services-counter: interest list; lead matching; a transactional capture that fills only the lead's blank fields (ALREADY_CAPTURED 409 carries the existing eventLeadUuid); the event leads listing with filters; the event lead edit.
mobile-api: /api/admin/interests and /api/admin/event-leads/**.
Mobile numbers are normalised with libphonenumber (Malaysia by default); emails are trimmed and lowercased.
The salesperson must be on the event's team; an unchanged value may stay.
Only enabled events take leads, and inactive interests can't be newly added.
Admin portal:
an Interests screen;
one proxy route for event leads, which rejects . and .. path segments;
the event picker;
the listing (a table on wide screens, cards on phones);
a two-step key-in form (match first, then details);
the event lead edit page.
Verification
mvn -T 1C verify for mobile-api and services-counter: 544 tests, 0 failures.
Portal: vitest 143 files / 1081 tests, tsc ok, lint has 0 errors (4 warnings that were already there), next build ok.
Every task passed an Opus review gate, and a final whole-branch review returned READY.
Playwright on the local stack, at desktop width and at 360×780 (no sideways scroll):
capturing a new lead;
the same mobile in another format at a second event, matched as EXISTING with its blank email filled;
a different person with the same mobile;
the already-captured case;
the invalid mobile and missing contact errors;
an off-team salesperson refused (NOT_ON_TEAM, through the API);
the listing filters and the edit page;
a user without the modules sees "Not authorised", and the API returns 403.
Known gaps and follow-ups
The change-3 event table has no company_id, so event lookups are not limited to one company. This is recorded in design.md and should be fixed with the multi-company move.
The EventLeadRepository.search and findMatches queries are proven only by the live MySQL check. A @DataJpaTest with Testcontainers would cover them.
Salesperson names are fetched with one /user/findById call per team member. Teams are small, so this is fine for now.
Two EXISTING captures of the same lead at the same moment could lose one blank-field fill.
Lead Listing, lead detail and CSV exports are change 4b.
## Summary
Implements OpenSpec change `add-event-lead-capture`: interests, and capturing leads at events from a phone.
- **Database** (`service-counter`): `lead`, `event_lead`, `interest` and `event_lead_interest` tables, plus the `BO_EVENT_LEADS` and `BO_INTERESTS` modules. The SQL is in the change folder and mirrored in `local/seed/03-colite.sql`.
- **services-counter**: interest list; lead matching; a transactional capture that fills only the lead's blank fields (`ALREADY_CAPTURED` 409 carries the existing `eventLeadUuid`); the event leads listing with filters; the event lead edit.
- **mobile-api**: `/api/admin/interests` and `/api/admin/event-leads/**`.
- Mobile numbers are normalised with libphonenumber (Malaysia by default); emails are trimmed and lowercased.
- The salesperson must be on the event's team; an unchanged value may stay.
- Only enabled events take leads, and inactive interests can't be newly added.
- **Admin portal**:
- an Interests screen;
- one proxy route for event leads, which rejects `.` and `..` path segments;
- the event picker;
- the listing (a table on wide screens, cards on phones);
- a two-step key-in form (match first, then details);
- the event lead edit page.
## Verification
- `mvn -T 1C verify` for mobile-api and services-counter: 544 tests, 0 failures.
- Portal: vitest 143 files / 1081 tests, `tsc` ok, lint has 0 errors (4 warnings that were already there), `next build` ok.
- `openspec validate add-event-lead-capture --strict` passes.
- Every task passed an Opus review gate, and a final whole-branch review returned READY.
- Playwright on the local stack, at desktop width and at 360×780 (no sideways scroll):
- capturing a new lead;
- the same mobile in another format at a second event, matched as EXISTING with its blank email filled;
- a different person with the same mobile;
- the already-captured case;
- the invalid mobile and missing contact errors;
- an off-team salesperson refused (`NOT_ON_TEAM`, through the API);
- the listing filters and the edit page;
- a user without the modules sees "Not authorised", and the API returns 403.
## Known gaps and follow-ups
- The change-3 `event` table has no `company_id`, so event lookups are not limited to one company. This is recorded in `design.md` and should be fixed with the multi-company move.
- The `EventLeadRepository.search` and `findMatches` queries are proven only by the live MySQL check. A `@DataJpaTest` with Testcontainers would cover them.
- Salesperson names are fetched with one `/user/findById` call per team member. Teams are small, so this is fine for now.
- Two EXISTING captures of the same lead at the same moment could lose one blank-field fill.
- Lead Listing, lead detail and CSV exports are change 4b.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Picker lists events with those running today first. The listing filters
by salesperson, temperature, status, interest and lead type, with a
table at md and up and tappable cards on phones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Step 1 matches on mobile or email and offers each candidate (or opens an
already-captured one). Step 2 captures a new or picked lead with
salesperson, temperature, status, interests and follow-up date. A picked
lead only gets contact values that are its own, so no two people merge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Implements OpenSpec change
add-event-lead-capture: interests, and capturing leads at events from a phone.service-counter):lead,event_lead,interestandevent_lead_interesttables, plus theBO_EVENT_LEADSandBO_INTERESTSmodules. The SQL is in the change folder and mirrored inlocal/seed/03-colite.sql.ALREADY_CAPTURED409 carries the existingeventLeadUuid); the event leads listing with filters; the event lead edit./api/admin/interestsand/api/admin/event-leads/**..and..path segments;Verification
mvn -T 1C verifyfor mobile-api and services-counter: 544 tests, 0 failures.tscok, lint has 0 errors (4 warnings that were already there),next buildok.openspec validate add-event-lead-capture --strictpasses.NOT_ON_TEAM, through the API);Known gaps and follow-ups
eventtable has nocompany_id, so event lookups are not limited to one company. This is recorded indesign.mdand should be fixed with the multi-company move.EventLeadRepository.searchandfindMatchesqueries are proven only by the live MySQL check. A@DataJpaTestwith Testcontainers would cover them./user/findByIdcall per team member. Teams are small, so this is fine for now.🤖 Generated with Claude Code
https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM