Ship leftover Yimaru login/personas, sidebar sections, filter modal, chart/stat clip fixes, and matching feature docs so the polish work is fully committed. Co-authored-by: Cursor <cursoragent@cursor.com>
3.7 KiB
Feature: Member experience
Member portal — allowance summary, order history, prescription upload/status, loyalty pointer.
Workspace: /Users/kirukib/Desktop/Yaltopia Project/Gishen-B2B
Pages
| Route | Purpose |
|---|---|
/me |
Home — plan/allowance, refill reminders, shop CTA |
/me/orders |
Covered order history |
/prescriptions |
Rx list with status |
/prescriptions/new |
Multi-page upload wizard |
Entities
Endpoints
| Endpoint | Purpose |
|---|---|
GET /v1/auth/me |
Session + allowance snippet |
GET /v1/me/package |
Package + allowance detail |
GET /v1/customers/:id/orders* |
Order history |
GET/POST /v1/prescriptions* |
Rx CRUD + submit |
GET /v1/prescriptions/refill-reminders |
Upcoming refills |
* Shared customer orders API — spec owned with Ecom; mocked in B2B phase.
/me home sections
| Section | Content |
|---|---|
| Allowance card | Total, used, remaining (mint progress bar) |
| Package summary | Plan name, co-pay %, key perks |
| Refill reminders | Prescriptions due within N days |
| Shop CTA | Deep link to Ecom with coverage |
| Loyalty teaser | Points balance pointer — full UI in Ecom/Mob |
Order history (/me/orders)
Member sees own orders with:
- Date, order ID, total
- Org-covered vs member-paid split
- Status (processing, delivered, etc.)
- Line items with product names (member owns their data)
Prescriptions
Upload flow (/prescriptions/new)
- Create draft
- Upload pages (jpeg/png/pdf) — multi-page
- Review thumbnails
- Submit →
prescription.submittedevent - Track status on
/prescriptions
Status display
| Status | Member UX |
|---|---|
submitted |
"Waiting for review" |
under_review |
"Pharmacist reviewing" |
approved |
"Approved — ready to order" |
queried |
Show query message + resubmit |
rejected |
Show reason + contact support |
Review happens in Admin — B2B consumes prescription.review_updated.
Refill reminders
When days_supply set and refill_due_at approaching, show banner on /me.
Clinical access
Members see full own prescription data including images and approved medicine lines.
HR/Finance cannot access member prescription routes — 403.
SUPER_USER may view any member's Rx for support via /members/[id] + prescription endpoints.
Checkout entitlement
B2B shows remaining allowance. Basket split UI at checkout lives in Gishen-Ecom:
Allowance remaining: 10,800 ETB
[ Shop with coverage → Ecom ]
See open-items.md.
Pharmacy ID card
Members can view/print their pharmacy verification badge from /members/[id] (own record) when linked. QR payload:
gishen://member/{memberId}?v={verificationId}
HR/SUPER_USER print cards for employees from the member detail ID card tab. See members.md.
Platform notes
- Web upload mirrors Ecom Rx UX
- Edge-detection camera: Mobile-only (Gishen-Mob)
- No handwritten OCR
Validation / errors
| Scenario | Code |
|---|---|
| Submit Rx without pages | VALIDATION_FAILED |
| Inactive member | MEMBER_INACTIVE |
| Non-member on member routes | FORBIDDEN |
UI components
- Allowance hero card (Gishen mint/forest)
- Order list with split amounts
- Rx upload dropzone + page gallery
- Status timeline component
- Refill reminder alert
Related
- packages.md — entitlement rules
- auth-roles.md — MEMBER role
- gishen-ecom.md — checkout split