docs: add profiles, skill catalog, and LynkDispatch AI-context to spec

This commit is contained in:
Satyam Rastogi
2026-05-29 02:11:16 +05:30
parent b0de8b9ec1
commit 20fe4e6ba7
@@ -122,12 +122,31 @@ Status set (replaces flat Assigned/In Progress/…), **each transition carries a
- Task detail modal: richer progress — stage timeline, current stage + who/when, review results, issues list with photos.
- Same task + stage visible in the **subcontractor's own login**; sub can advance self-stages / log rework issues.
## 10. Profiles, skill catalog & AI dispatch context
Every person (employee **and** subcontractor) gets a two-layer `profile`, surfaced through a self-service **User Details** page (all roles, including owners) and an owner-facing **Employee/Subcontractor Details** view.
**① Self section** (person edits; owner can view): preferred name, photo, phone, alt contact, address, emergency contact; short bio, years of experience/since-date, languages; self-declared specialties + **equipment carried** (e.g., tarp, ladder rack, drone); availability/service areas. Subcontractors also: company name, license #, insurance/COI + expiry, W-9 status.
**② Company section** (owner/admin edits; **private to owner/admin — not shown to the person**): company bio / internal notes ("reliable in storms, keeps a tarp on the truck"); internal status/tags (preferred / probation / do-not-use); **skill scores** (see below); pay/commission terms; hire date; manager.
**③ Achievements & levels** (employees): read-only, pulled from ProCanvas gamification (level, XP, streak, badges, achievement tiers).
**Skill catalog (shared, org-level):** `skillCatalog[]` = `{ id, name, description }` defined by the owner. Each person carries `skillScores[]` = `{ skillId, score: 0100 | 'N/A' }`. Comparable across people; new skills added org-wide.
**AI dispatch context (coherence with LynkDispatch):** `DISPATCH_REPS` map to canonical people; each rep's profile (equipment + skill scores + notes) is the structured context the dispatch engine references. The pre-authored `DISPATCH_RECOMMENDATIONS` (`factors.skillMatch`, `reasons[]`, `aiInsight`) are written to **cite real profile facts** (e.g., *"Carlos — 92 Emergency Tarp · carries tarp on truck"*), so "the AI read their profile" is demonstrably true on screen.
**Pages/access:**
- **User Details / My Profile** (`/me/profile` or similar) — every logged-in role edits their self-section + sees their achievements.
- **Owner Employee/Subcontractor Details** — extends People/Vendor directories with a person detail view showing the full profile incl. company section + skill scores; owner edits company notes/scores and manages the skill catalog.
---
## Coherency map (everything ties to a real project)
- Subcontractor task → real project → visible in sub login + owner project Team/Tasks tab + subcontractor-tasks page.
- Estimate versions → the project's signed estimate is the deal (matches lead's Estimate Sent/Signed pipeline stage).
- Lifecycle/inspection/issues/scope-variance → live on the project; surfaced on owner detail, pipeline lead-project view, and dashboard counts.
- Profiles/skills/equipment → attached to canonical people; surfaced on User Details + owner Employee Details; cited by LynkDispatch recommendations; subcontractor profile visible in their own login.
## Components / files touched
- `src/data/mockStore.jsx` — identity remap, leads seed, financial fixes, breakdowns, 10 threaded scenarios, sub logins, deeper tables, pipeline values, lifecycle/inspection/estimate/scope data, sub-task stage data. (Large file; surgical/additive edits.)
@@ -149,7 +168,8 @@ Status set (replaces flat Assigned/In Progress/…), **each transition carries a
7. Project lifecycle state machine + progress %.
8. Inspections (damage + final) + scope-variance badge + estimate versions.
9. Subcontractor task stage machine + UI.
10. Verify build + reconciliation spot-checks at each major step.
10. Profiles + skill catalog + User Details page + owner Employee Details + dispatch AI-context wiring.
11. Verify build + reconciliation spot-checks at each major step.
## Verification
- `npm run build` clean after each major step.