2.7 KiB
2.7 KiB
Task D3.1: Leads / Enquiries Navigation Separation
Files Added
src/app/dashboard/crm/leads/page.tsxsrc/app/dashboard/crm/leads/[id]/page.tsxdocs/implementation/task-d31-leads-enquiries-navigation-separation.md
Files Modified
src/config/nav-config.tssrc/lib/auth/rbac.tssrc/app/dashboard/crm/enquiries/page.tsxsrc/app/dashboard/crm/enquiries/[id]/page.tsxsrc/app/api/crm/enquiries/route.tssrc/features/crm/dashboard/components/dashboard-summary-cards.tsxsrc/features/crm/enquiries/api/types.tssrc/features/crm/enquiries/api/service.tssrc/features/crm/enquiries/api/mutations.tssrc/features/crm/enquiries/components/enquiry-listing.tsxsrc/features/crm/enquiries/components/enquiries-table.tsxsrc/features/crm/enquiries/components/enquiry-columns.tsxsrc/features/crm/enquiries/components/enquiry-cell-action.tsxsrc/features/crm/enquiries/components/enquiry-form-sheet.tsxsrc/features/crm/enquiries/components/enquiry-detail.tsxsrc/features/crm/enquiries/server/service.tsdocs/adr/0011-lead-enquiry-ownership-model.md
Navigation Changes
- Split the combined CRM workspace into
LeadsandEnquiries. - Kept a single shared feature module by reusing
src/features/crm/enquiries/**.
Route Changes
- Added
/dashboard/crm/leads - Added
/dashboard/crm/leads/[id] - Reused the same list/detail backend and scoped each page with
pipelineStage - Redirected lead detail to enquiry detail when the record has already moved past the
leadstage
Permission Changes
- Added:
crm.lead.readcrm.lead.createcrm.lead.updatecrm.lead.assigncrm.lead.delete
- Mapped
marketingto lead-centric permissions - Kept
saleson enquiry-centric permissions - Gave manager roles both lead and enquiry capabilities
Query Invalidation Added
- CRM enquiry mutations now invalidate lead/enquiry list queries, detail queries, follow-up queries, and CRM dashboard KPI queries.
- Assigned leads now disappear from the Leads workspace and appear in the Enquiries workspace without manual refresh.
Dashboard Changes
- Lead KPI card links to
/dashboard/crm/leads - Enquiry KPI card links to
/dashboard/crm/enquiries - List filtering now accepts
pipelineStagefor workspace drill-down
ADR Updates
- Added a
Navigation Separationsection to ADR 0011 - Clarified that lead/enquiry are UX workspaces, not separate persisted entities
Remaining Risks
- Shared route handlers still live under the enquiry API namespace by design, so the lead workspace depends on the shared
crm_enquiriesbackend contract. - Manager permission breadth may need later refinement if
department_managerandtop_managershould diverge.