Deliver role-aware shell (sidebar, breadcrumbs, quick search, tables, detail/create layouts), locale-ready pages, shared backend/feature docs, and Vercel project config so HR, finance, and members can demo against typed mocks. Co-authored-by: Cursor <cursoragent@cursor.com>
5.7 KiB
Features index
Feature → pages → entities → endpoints mapping for Gishen-B2B §3 features.
Workspace: /Users/kirukib/Desktop/Yaltopia Project/Gishen-B2B
Standing rule: Update this file whenever UI routes or capabilities change. See ../README.md.
Summary table
| Feature | Pages | Entities | Endpoints | Feature doc |
|---|---|---|---|---|
| Auth & roles | /login |
SessionUser | auth.md |
auth-roles.md |
| Quick search | Portal topbar (Cmd/Ctrl+K) | — | — | quick-search.md |
| Portal layout | All portal (PageShell, DetailPageLayout, Bc, StatCard, Tabs) | — | — | portal-layout.md |
| i18n | /login, all portal |
SessionUser (locale) |
PATCH /v1/auth/me/locale |
i18n.md |
| Org registration | /register/organisation, /register/request, /login |
OrgRegistration, OrgRegistrationRequest, Organisation | org.md (register*) |
org-registration.md |
| Org & departments | /organisation, /departments, /departments/new, /departments/[id], /settings/verification |
Organisation, Department | org.md |
org-departments.md |
| Data migration | /migration, /migration/new, /migration/[jobId] |
MigrationJob | migration.md |
migration.md |
| Members & onboarding | /members, /members/new, /members/import, /members/[id], /join, /invite/[token] |
Member | members.md |
members.md |
| Packages & entitlements | /packages, /packages/new, /packages/[id], /me |
Package, Member (overrides) |
packages.md |
packages.md |
| Finance | /finance, /finance/spend/[id], /finance/approvals, /statements, /statements/[id] |
Finance (SpendSummary, Statement, ApprovalFlag) | finance.md |
finance.md |
| Member experience | /me, /me/orders, /me/orders/[id] |
Member, Package | packages.md (/me/package), Ecom orders* |
member-experience.md |
| Prescriptions | /prescriptions, /prescriptions/new, /prescriptions/[id] |
Prescription | prescriptions.md |
— (see member-experience) |
* /me/orders consumes shared customer order API (Ecom spec); allowance from B2B packages API.
Events by feature
| Feature | Events emitted | Events consumed |
|---|---|---|
| Org registration | org.registration_submitted, org.registration_requested |
org.activated |
| Data migration | migration.job_started, migration.job_completed, migration.job_failed |
— |
| Prescriptions | prescription.submitted |
prescription.review_updated |
| Finance | — | order.completed (future) |
Role × feature matrix
| Feature | SUPER_USER | HR_ADMIN | FINANCE | MEMBER |
|---|---|---|---|---|
| Auth & roles | ✓ | ✓ | ✓ | ✓ |
| i18n | ✓ | ✓ | ✓ | ✓ |
| Org registration | ✓ (public) | — | — | — |
| Org & departments | ✓ | ✓ | read | — |
| Data migration | ✓ | ✓ | read | — |
| Members | ✓ | ✓ | read | own |
| Packages | ✓ | ✓ | read | own |
| Finance | ✓ | summary | ✓ | — |
| Member experience | ✓ | — | — | ✓ |
| Prescriptions | ✓ full | withheld | withheld | own |
Clinical withhold by feature
| Feature | HR_ADMIN / FINANCE restriction |
|---|---|
| Members | Metadata only; prescription_count not detail |
| Finance | Category + amount aggregates; no medicine names |
| Prescriptions | 403 / redacted |
| Member experience | N/A for HR/Finance routes |
SUPER_USER bypasses all withhold rules.
Cross-repo dependencies
| Feature | Sibling repo |
|---|---|
| Org registration activation | Admin |
| Prescription review | Admin |
| Checkout entitlement split | Ecom |
/me/orders |
Ecom (shared orders API) |
| Statements PDF | Admin / billing |
See ../coordination/.
Route completeness check
All §3 routes from product brief:
/login/register/organisation,/register/request/organisation,/departments,/departments/new,/departments/[id],/settings/verification/migration,/migration/new,/migration/[jobId]/members,/members/new,/members/import,/members/[id],/join,/invite/[token]/packages,/packages/new,/packages/[id]/me,/me/orders,/me/orders/[id]/prescriptions,/prescriptions/new,/prescriptions/[id]/finance,/finance/spend/[id],/finance/approvals,/statements,/statements/[id]
Quick directory (standing rule)
Portal top-bar command search is driven by src/lib/nav/quick-directory.ts. Update that module (and quickSearch.* i18n keys) whenever you add portal routes or primary create actions. See quick-search.md.
List UX
All primary tables include in-card search + filter toolbar (TableToolbar): members, packages, departments, migration, prescriptions, finance spend, approvals, statements, member orders. List query params for backend: q, status / category / site (see endpoint docs).
Detail UX
Yimaru-style DetailHero + DetailSection layouts with demo mutations (invite/offboard, package activate, migration commit/rollback, statement issue/pay, approval approve/flag). Dashboard uses Recharts placeholders from statements/spend/departments/packages.
Spec file paths
docs/backend/entities/ → data model
docs/backend/endpoints/ → API contract
docs/backend/events/ → domain events
docs/features/*.md → feature notes (this directory)
docs/coordination/ → Admin/Ecom alignment