4.9 KiB
4.9 KiB
Task D.5.4: Lead / Enquiry Workspace Separation UI Foundation
Objective
Establish separate CRM workspaces for marketing-owned Leads and sales-owned Enquiries without changing existing quotation, dashboard, reporting, or approval behavior.
Review Completed
AGENTS.mdplans/task-d.5.4.mddocs/standards/project-foundations.mddocs/standards/task-catalog.mddocs/adr/0018-lead-enquiry-domain-separation.mddocs/implementation/task-d5-lead-enquiry-domain-separation.mddocs/implementation/task-d52-lead-domain-service-api-foundation.mddocs/implementation/task-d53-lead-assignment-create-enquiry-foundation.mddocs/security/crm-authorization-boundaries.mdsrc/config/nav-config.ts- existing enquiry list, detail, form, and assignment UI
- existing lead route handlers and lead assignment route
What Changed
- Replaced legacy lead route aliases with real lead pages:
- Added lead client API/query/mutation stack:
- Added lead UI foundation:
- Extended lead domain read models in:
- Lead detail now surfaces:
- linked enquiries
- assignment result visibility
- audit-safe activity list
- customer/contact/assignable-user reference data for forms
- Enquiry detail compatibility updated in page.tsx:
- preserves existing enquiry component contract
- loads linked lead server-side when
leadIdexists - shows a read-only
Source Leadblock with open-lead navigation
- Enquiry read DTO now includes
leadIdin:
APIs Consumed
GET /api/crm/leadsPOST /api/crm/leadsGET /api/crm/leads/[id]PATCH /api/crm/leads/[id]DELETE /api/crm/leads/[id]POST /api/crm/leads/[id]/followupsPOST /api/crm/leads/[id]/assign- existing enquiry detail and follow-up APIs remain unchanged
Permission Mapping
- Lead list/detail visibility uses:
crm.lead.read
- Lead create button and create form use:
crm.lead.create
- Lead edit actions use:
crm.lead.update
- Lead delete action uses:
crm.lead.delete
- Lead assignment action uses:
crm.lead.assign
- Enquiry detail compatibility block does not widen enquiry permissions; it only renders when the user can already open the enquiry page.
Compatibility Notes
- CRM nav already exposed separate Leads and Enquiries entries, so D.5.4 kept navigation structure and replaced the lead pages behind it.
- Lead assignment still goes through the D.5.3 server assignment flow and does not create enquiries client-side.
- Existing enquiry workflow, quotation conversion flow, dashboard datasets, and reports were not changed.
Known Limitations
- Lead form intentionally does not introduce a separate persisted
notesfield because D.5.4 is out of scope for schema changes. - Lead follow-up entry uses the existing audit-backed foundation and remains compatible with the current D.5.2 persistence approach.
Verification
npm exec tsc --noEmit