feat(projects): add the Projects CRM module #32
Reference in New Issue
Block a user
Delete Branch "feat/projects"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds the Projects module to the CRM dashboard — a Construction jobs + Pipeline Leads screen, following
DEV_GUIDE_PROJECTS_MODULE.md's backend-already-built pattern (mirrorsteam-api.ts/team-management.tsx).What's in this PR
Data layer (
src/lib/projects-api.ts)useProjectsData()— live (crm.project.*via be-crm) or local mock, picked byisShellConfigured(), same pattern asuseTeamData().Projectmodel (name/status/value/owner/address/dates) and resolvesownerPrincipalId→ a real name viacrm.team.member.search.UiProjectStatusmapping between the mock's 4 statuses (Active/Complete/Stuck/Follow-up) and be-crm's 6 (lead/active/on_hold/won/lost/archived).Mock data (
src/components/dashboard/projects-data.ts)collectionsFor) per construction job, backing the collections ledger below.View (
src/components/dashboard/projects.tsx)Wiring
dashboard.tsx's view switch and gated on thepipeline.managepermission insidebar.tsx(matches how be-crm gates everycrm.project.*action server-side).Modalcomponent (ui.tsx) with an optionalheaderExtraslot and anxlsize to support the collections modal.Test plan
tsc --noEmitandeslintcleancrm.project.*CRUD chain exercised directly against a local be-crm instance (list/create/setStatus/remove), then cleaned up