This repository has been archived on 2026-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
Gishen-B2B/docs/features/INDEX.md
kirukib f2e992e0bd Add multi-method login UI and document auth method contracts.
Surface Google, email, phone, and Telegram on login (mocked), polish the brand panel and fixes for Button/Menu, and keep the backend spec sheet aligned.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 16:12:43 +03:00

112 lines
6.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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`](../README.md).
## Summary table
| Feature | Pages | Entities | Endpoints | Feature doc |
|---------|-------|----------|-----------|---------------|
| Auth & roles | `/login` (Google / email / phone / Telegram UI + demo personas) | SessionUser | `auth.md` | [auth-roles.md](auth-roles.md) |
| Profile | `/profile` | SessionUser | `auth.md` (`/v1/me/profile`) | [profile.md](profile.md) |
| Quick search | Portal topbar (Cmd/Ctrl+K) | — | — | [quick-search.md](quick-search.md) |
| Portal layout | All portal (PageShell, DetailPageLayout, Bc, StatCard, Tabs) | — | — | [portal-layout.md](portal-layout.md) |
| i18n | `/login`, all portal | SessionUser (`locale`) | `PATCH /v1/auth/me/locale` | [i18n.md](i18n.md) |
| Org registration | `/register/organisation`, `/register/request`, `/login` | OrgRegistration, OrgRegistrationRequest, Organisation | `org.md` (register*) | [org-registration.md](org-registration.md) |
| Org & departments | `/organisation`, `/departments`, `/departments/new`, `/departments/[id]`, `/settings/verification` | Organisation, Department | `org.md` | [org-departments.md](org-departments.md) |
| Data migration | `/migration`, `/migration/new`, `/migration/[jobId]` | MigrationJob | `migration.md` | [migration.md](migration.md) |
| Members & onboarding | `/members`, `/members/new`, `/members/import`, `/members/[id]`, `/join`, `/invite/[token]` | Member | `members.md` | [members.md](members.md) |
| Packages & entitlements | `/packages`, `/packages/new`, `/packages/[id]`, `/me` | Package, Member (`overrides`) | `packages.md` | [packages.md](packages.md) |
| Finance | `/finance`, `/finance/spend/[id]`, `/finance/approvals`, `/statements`, `/statements/[id]` | Finance (SpendSummary, Statement, ApprovalFlag) | `finance.md` | [finance.md](finance.md) |
| Member experience | `/me`, `/me/orders`, `/me/orders/[id]` | Member, Package | `packages.md` (`/me/package`), Ecom orders* | [member-experience.md](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 | ✓ | ✓ | ✓ | ✓ |
| Profile | ✓ | ✓ | ✓ | ✓ |
| 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/`](../coordination/).
## Route completeness check
All §3 routes from product brief:
- [x] `/login`
- [x] `/profile`
- [x] `/register/organisation`, `/register/request`
- [x] `/organisation`, `/departments`, `/departments/new`, `/departments/[id]`, `/settings/verification`
- [x] `/migration`, `/migration/new`, `/migration/[jobId]`
- [x] `/members`, `/members/new`, `/members/import`, `/members/[id]`, `/join`, `/invite/[token]`
- [x] `/packages`, `/packages/new`, `/packages/[id]`
- [x] `/me`, `/me/orders`, `/me/orders/[id]`
- [x] `/prescriptions`, `/prescriptions/new`, `/prescriptions/[id]`
- [x] `/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](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. Member detail includes printable pharmacy ID card (`GET /v1/members/:id/id-card`).
## 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
```