1.7 KiB
1.7 KiB
Task C.1: Customer Ownership and Contact Sharing Governance
Summary
Task C.1 completes the missing customer-governance layer by adding:
- persistent customer owner fields and owner history
- persistent contact sharing
- owner/share-aware customer and contact visibility
- lead owner suggestion during lead/enquiry creation
Delivered
- Added
ownerUserId,ownerAssignedAt, andownerAssignedBytocrm_customers - Added
crm_customer_owner_history - Added
crm_contact_shares - Added customer owner management route:
PATCH /api/crm/customers/[id]/ownerDELETE /api/crm/customers/[id]/owner
- Added contact sharing routes:
GET /api/crm/customers/[id]/contacts/[contactId]/sharesPOST /api/crm/customers/[id]/contacts/[contactId]/sharesDELETE /api/crm/customers/[id]/contacts/[contactId]/shares/[shareId]
- Expanded customer list/detail contracts with owner and share metadata
- Added customer owner card with history on customer detail
- Added contact sharing management UI on customer detail
- Added owner columns and owner filter on customer list
- Added new permissions:
crm.customer.owner.readcrm.customer.owner.managecrm.contact.share.readcrm.contact.share.createcrm.contact.share.deletecrm.contact.share.manage
- Added lead/enquiry assignee suggestion from selected customer owner
- Added audit events for:
assign_ownerchange_ownerclear_ownershareunsharelead_owner_suggestion_usedlead_owner_suggestion_overridden
Verification
npx tsc --noEmit
Remaining limitation
- Team-scope visibility is still approximate because the production model still lacks an explicit CRM team hierarchy.