Files
alla-allaos-fullstack/docs/implementation/task-d54-lead-enquiry-workspace-separation-ui-foundation.md
phaichayon 6093003b70 task-d.5.4
2026-06-25 08:06:53 +07:00

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.md
  • plans/task-d.5.4.md
  • docs/standards/project-foundations.md
  • docs/standards/task-catalog.md
  • docs/adr/0018-lead-enquiry-domain-separation.md
  • docs/implementation/task-d5-lead-enquiry-domain-separation.md
  • docs/implementation/task-d52-lead-domain-service-api-foundation.md
  • docs/implementation/task-d53-lead-assignment-create-enquiry-foundation.md
  • docs/security/crm-authorization-boundaries.md
  • src/config/nav-config.ts
  • existing enquiry list, detail, form, and assignment UI
  • existing lead route handlers and lead assignment route

What Changed

APIs Consumed

  • GET /api/crm/leads
  • POST /api/crm/leads
  • GET /api/crm/leads/[id]
  • PATCH /api/crm/leads/[id]
  • DELETE /api/crm/leads/[id]
  • POST /api/crm/leads/[id]/followups
  • POST /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 notes field 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