Customer Portal & My Home — Kiến trúc & dữ liệu
Bootstrap theo app mode
- Staff context store (
currentUserTopi,currentUserLinkedSites) chỉ populate trong Admin Mode. _aselector trênConsumerAccount: admin chọn account customer → vẫn gọi được ở Admin Mode; chỉ caller's own account bị loại khỏi bootstrap.
Layout & width
- Mọi standard page dùng chung shell → chuyển giữa Booking UI và portal không thay đổi max-width.
- Local max-width conflict với canonical → bỏ/thay rule, trừ khi là exception được document.
- Opt-out exception không đổi behavior mặc định.
Timezone resolution
- Backend trả source datetime; frontend branch display (INV-ENTTZMODE-002).
- Save timezone: staff prompt →
POST /api/User/UpdateUserTimezoneIdentifier; sidebar →updateUserTimezone(newWindowsId); cả hai lưu Windows TZ ID. - Rehydrate sau reload từ
ConsumerManage/CurrentUser, không cần request phụ.
Prompt & popup gating
- Staff My Home prompt: flag
my-home-tz-prompted, bắt buộc save (không dismissible). - Portal session popup: flag
tz-popup-dismissed, save hoặc dismiss đều set. - Mismatch detection chỉ chạy với authenticated MultiZone user, chưa dismiss.
My Subscriptions — read boundary
- My Bookings dùng chung row model: section theo tab Pending/Confirmed/Cancelled; tab Waiting/Cart không render.
- Switch tab filter trên data đã fetch, không re-fetch.
Share link composition
- INV-CP-SHARELINK-001: compose theo Customer Portal base URL, không theo browser origin khi origin có thể là Admin Portal.
API chính
| Mục đích | API | Mode |
|---|---|---|
| Staff context | GET /api/Manage/CurrentUser, GET /api/Employee/LinkOrg | Admin Mode |
| Caller account | GET /api/ConsumerAccount (không _a) | ngoài Admin Mode |
| Consumer identity + timezone | GET /api/ConsumerManage/CurrentUser | mọi mode |
| Update timezone | POST /api/User/UpdateUserTimezoneIdentifier (Windows TZ ID) | staff prompt / updateUserTimezone |
| My Subscriptions | route /{curl}/enrollments (backend account-scoped) | authenticated |
Ranh giới sở hữu
| Khối | Ai được sửa |
|---|---|
| Hiển thị timezone, layout, prompt/session flag | Frontend (không mutate backend) |
User.TimezoneIdentifier | Chỉ qua API update timezone |
| Enrollment / booking / billing / invoice / payment / credit note | Chỉ service backend hiện có; portal read-only |
| Share URL | Frontend compose theo Customer Portal origin, không đổi bởi browser origin |