Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
6.7 KiB
Spec Delta
Purpose
Staff capture leads at an event, learn whether each person is new or already known, and work through the event's leads.
ADDED Requirements
Requirement: Choose an event
The system SHALL let a user with BO_EVENT_LEADS choose among the company's enabled events to capture and list leads. Capturing a lead for a disabled event SHALL be refused.
Scenario: Only enabled events offered
- GIVEN an enabled event
KL Food Fair 2027and a disabled eventPenang Expo - WHEN a user with
BO_EVENT_LEADSopens Event leads - THEN
KL Food Fair 2027is offered andPenang Expois not
Scenario: Disabled event refuses capture
- WHEN a lead is submitted for a disabled event
- THEN the capture is refused and nothing is saved
Scenario: No module
- WHEN a user without
BO_EVENT_LEADSopens Event leads or calls an event-leads endpoint - THEN the page shows not-authorised and the endpoint responds 403
Requirement: Contact normalisation
The system SHALL require a mobile number, an email, or both, for every captured lead, and a name. The system SHALL normalise a mobile number to E.164, treating a number without a country code as Malaysian (+60), and SHALL refuse a number that is not valid. The system SHALL trim and lowercase an email and refuse one that is not an email address.
Scenario: Malaysian formats are one number
- WHEN staff enter
012-345 6789,0123456789,+60 12-345 6789or60123456789 - THEN each is stored and matched as
+60123456789
Scenario: Email case and spaces
- WHEN staff enter
Aisyah@Example.COM - THEN it is stored and matched as
aisyah@example.com
Scenario: Neither mobile nor email
- WHEN staff submit a lead with no mobile and no email
- THEN the capture is refused and both fields are named
Scenario: Invalid mobile
- WHEN staff enter
12345as the mobile - THEN the capture is refused with a message on the mobile field
Requirement: New or existing lead
The system SHALL show, before capture, the company's leads matching the entered mobile or email. A capture with no match or as a different person SHALL create a new lead marked NEW. A capture of a picked match SHALL be marked EXISTING and SHALL fill only that lead's blank fields. The mark SHALL never be recalculated. The lead and its event lead SHALL be saved together or not at all.
Scenario: First time seen
- GIVEN no lead with mobile
+60123456789 - WHEN staff capture
Aisyahwith0123456789atKL Food Fair 2027 - THEN a new lead is created and the event lead is NEW
Scenario: Known person picked
- GIVEN a lead
Aisyahwith mobile+60123456789and no email, captured at an earlier event - WHEN staff enter
012-345 6789andaisyah@example.com, and pickAisyahfrom the matches - THEN the event lead is EXISTING
- AND the lead now has email
aisyah@example.comand its name is unchanged
Scenario: Stored values are not overwritten
- GIVEN a lead with company
Acme - WHEN staff pick that lead and enter company
Other Co - THEN the lead's company stays
Acme
Scenario: Mobile and email match different people
- GIVEN lead
Awith mobile+60123456789and leadBwith emailb@example.com - WHEN staff enter that mobile and that email
- THEN both
AandBare shown as matches and nothing is merged
Scenario: Different person
- GIVEN a lead with mobile
+60123456789 - WHEN staff choose a different person and capture
Ahmadwith that mobile - THEN a second lead
Ahmadis created and the event lead is NEW
Scenario: Already captured at this event
- GIVEN
Aisyahis already captured atKL Food Fair 2027 - WHEN staff enter her mobile there again
- THEN the match shows she is already captured and offers to open that event lead
- AND a capture of her at the same event is refused without creating anything
Requirement: Salesperson from the event team
The system SHALL let staff set an event lead's salesperson, which MAY be empty. A salesperson newly set on an event lead SHALL be an active member of that event's team. A salesperson already set SHALL remain allowed after they leave the team or are deactivated.
Scenario: Team member assigned
- GIVEN
KL Food Fair 2027hassales1andsales2on its team - WHEN staff capture a lead with salesperson
sales2 - THEN the event lead's salesperson is
sales2
Scenario: Outsider refused
- GIVEN
sales3is not on the team ofKL Food Fair 2027 - WHEN staff set
sales3as an event lead's salesperson there - THEN the save is refused with a message on the salesperson field
Scenario: Salesperson later removed from team
- GIVEN an event lead whose salesperson is
sales1 - WHEN
sales1is removed from the event's team and staff edit the lead's status - THEN the save succeeds and the salesperson stays
sales1
Requirement: Event leads listing
The system SHALL list one event's leads, newest capture first, paginated on the server, showing name, mobile, email, NEW or EXISTING, salesperson, temperature, status, interests and next follow-up date. The listing SHALL be filterable by salesperson, temperature, status, interest and NEW or EXISTING, and SHALL be usable at phone width.
Scenario: Filter by temperature
- GIVEN a HOT lead and a COLD lead at an event
- WHEN staff filter by HOT
- THEN only the HOT lead is listed
Scenario: Filter by interest
- GIVEN a lead tagged
Cookwareand a lead taggedKitchen appliances - WHEN staff filter by
Cookware - THEN only the lead tagged
Cookwareis listed
Scenario: Phone width
- WHEN staff open the listing on a 360 px wide screen
- THEN each lead shows as a card with name, mobile, NEW or EXISTING, temperature, status and next follow-up, with no sideways scrolling
Requirement: Event lead edit
The system SHALL let staff with BO_EVENT_LEADS change an event lead's salesperson, temperature, status, interests, next follow-up date and notes. Temperature SHALL be HOT, WARM, COLD or empty. Status SHALL be OPEN, CONTACTED, QUALIFIED, WON or LOST, and a new event lead SHALL be OPEN. Only active interests SHALL be newly added; an inactive interest already on the event lead SHALL stay until removed.
Scenario: Work a lead
- GIVEN an OPEN event lead
- WHEN staff set status CONTACTED, temperature HOT and next follow-up 2027-01-20
- THEN the listing shows CONTACTED, HOT and 20/01/2027 for that lead
Scenario: Inactive interest kept
- GIVEN an event lead tagged
Cookware, andCookwareis then deactivated - WHEN staff change the lead's status
- THEN the save succeeds and the lead is still tagged
Cookware