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>
101 lines
2.7 KiB
Markdown
101 lines
2.7 KiB
Markdown
# Feature: Members & onboarding
|
|
|
|
Employee and dependant enrolment — CRUD, quick import, invites, join codes, offboarding.
|
|
|
|
**Workspace:** `/Users/kirukib/Desktop/Yaltopia Project/Gishen-B2B`
|
|
|
|
## Pages
|
|
|
|
| Route | Purpose |
|
|
|-------|---------|
|
|
| `/members` | Searchable/filterable member list |
|
|
| `/members/new` | Invite / create employee (department + package) |
|
|
| `/members/import` | Quick Excel/CSV import |
|
|
| `/members/[id]` | Member detail — profile, package, dependants, offboard |
|
|
| `/join` | Self-join via join code or email domain |
|
|
| `/invite/[token]` | Accept invite and set password |
|
|
|
|
## Entities
|
|
|
|
- [`Member`](../backend/entities/member.md)
|
|
|
|
## Endpoints
|
|
|
|
- [`members.md`](../backend/endpoints/members.md)
|
|
|
|
## Capabilities
|
|
|
|
| Action | Roles |
|
|
|--------|-------|
|
|
| List / search | SUPER_USER, HR_ADMIN, FINANCE (metadata) |
|
|
| Create / edit | SUPER_USER, HR_ADMIN |
|
|
| Quick import | SUPER_USER, HR_ADMIN |
|
|
| Send/resend invite | SUPER_USER, HR_ADMIN |
|
|
| Add dependant | SUPER_USER, HR_ADMIN |
|
|
| Offboard | SUPER_USER, HR_ADMIN |
|
|
| Self-join | Public (join code / domain) |
|
|
| Accept invite | Public |
|
|
|
|
## Member lifecycle
|
|
|
|
```
|
|
invited → active → inactive | offboarded
|
|
```
|
|
|
|
Offboarding sets `end_date`; prescriptions remain on `customer_id` (portable).
|
|
|
|
## Dependants
|
|
|
|
- Linked via `primary_member_id`
|
|
- Subject to org `dependant_limit`
|
|
- Share primary's package by default; overrides optional
|
|
|
|
## Join rules (org-level)
|
|
|
|
Configured on `/organisation`:
|
|
|
|
- Join code (e.g. `ACME-2026`)
|
|
- Allowed email domains
|
|
- Optional expiry
|
|
|
|
## Quick import vs migration
|
|
|
|
| Path | Use case |
|
|
|------|----------|
|
|
| `/members/import` | Small ad-hoc batch |
|
|
| `/migration` | Full onboarding with mapping profiles |
|
|
|
|
Both use shared validation engine — see [migration.md](migration.md).
|
|
|
|
## Validation / errors
|
|
|
|
| Scenario | Code |
|
|
|----------|------|
|
|
| Duplicate phone in org | `DUPLICATE_MEMBER` |
|
|
| Duplicate employee_id | `DUPLICATE_MEMBER` |
|
|
| Dependant limit exceeded | `DEPENDANT_LIMIT_EXCEEDED` |
|
|
| Org pending | `ORG_PENDING` |
|
|
| Invite expired | `INVITE_EXPIRED` |
|
|
|
|
## Clinical withhold
|
|
|
|
Member list/detail for HR/Finance shows:
|
|
|
|
- Name, contact, employee ID, department, package, status
|
|
- Allowance summary (amounts)
|
|
- `prescription_count` (integer only)
|
|
|
|
No prescription list, images, or medicine detail. SUPER_USER sees full member record including Rx summary link.
|
|
|
|
## UI components
|
|
|
|
- DataTable with toolbar (search, status filter, department filter)
|
|
- Detail layout: profile card, package assignment, dependants tab, offboard dialog
|
|
- Import dropzone with template download
|
|
- Invite link copy + resend
|
|
|
|
## Related
|
|
|
|
- [packages.md](packages.md) — package assignment
|
|
- [member-experience.md](member-experience.md) — member portal after enrolment
|