Customer Portal & My Home — Dữ liệu & bảng đọc/ghi
Góc nhìn dữ liệu Customer Portal đọc/ghi. Quy ước: 📖 READ, ✏️ WRITE (insert/update).
Dữ liệu đọc/ghi
| Mảng | Dữ liệu |
|---|---|
| Staff context (Admin Mode) | GET /api/Manage/CurrentUser, GET /api/Employee/LinkOrg 📖 READ — populate currentUserTopi / currentUserLinkedSites. |
| Caller account (customer mode) | GET /api/ConsumerAccount (không _a) 📖 READ — populate current-account store. |
| Identity + timezone prefs | GET /api/ConsumerManage/CurrentUser 📖 READ — mọi mode, hydrate timezone/date-time (INV-USERTZAPI-002). |
| Display mode | EnterpriseSetting.ServiceAreaId 📖 READ — branch Local vs MultiZone. |
| User timezone | User.TimezoneIdentifier / timezoneIdentifier 📖 READ cho display + pre-select; ✏️ WRITE qua POST /api/User/UpdateUserTimezoneIdentifier hoặc updateUserTimezone(newWindowsId) (Windows TZ ID). |
| Session prompt state | sessionStorage['my-home-tz-prompted'], sessionStorage['tz-popup-dismissed'] ✏️ WRITE (client-side, không lên DB). |
| Subscription enrollments | Enrollment data scope theo authenticated account 📖 READ — site, subscription name, enrollment number, attendee, start/end date, status, sessions, weekly pattern, add-ons. |
| Booked periods | EnrollmentPeriod (chỉ IsActive = true và StatusId != Canceled) 📖 READ cho Booking Range + View Calendar. |
| Site contact | Site email, mobile/phone, address 📖 READ cho Booking UI Program Details + landing site card. |
| Share link | Không đọc/ghi DB; compose URL theo Customer Portal base URL (INV-CP-SHARELINK-001). |
Các mutation bị cấm ở portal
Load/expand/submit từ Customer Portal không được tạo hoặc mutate:
| Entity | Ghi chú |
|---|---|
TermBookingOrder / TermBooking | Chỉ service booking/confirmation backend. |
Enrollment / EnrollmentPeriod | Read-only ở portal; mutation chỉ qua service subscription. |
Billing / Invoice / CreditNote | Chỉ Finance/service hiện có. |
Payment | Chỉ Payment. |
Ví dụ thực tế: Khách mở rộng enrollment card hoặc bấm View Calendar. → Không được tạo state tài chính vô hình. → Chỉ có request đọc, không insert/update lên các entity trên.
Dữ liệu từ domain khác
| Domain | Portal đọc để làm gì |
|---|---|
| Subscription | Enrollment, enrollment number, program/session pattern, add-ons, booked periods. |
| Booking | Booking UI Program Details, site info modal, checkout flow. |
| Master Data | Site contact, account/attendee, BusinessUnitPermission, Class Program Category. |
| Finance | Invoice/paid status hiển thị (nếu action customer-facing invoice yêu cầu); không expose id admin nội bộ. |
| Payment | Trạng thái thanh toán cho subscription/booking (read-only hiển thị). |
Liên quan
- Kiến trúc & dữ liệu — bootstrap, timezone, share link, read boundary.
- Subscription — enrollment & subscription management.
- Booking — customer booking flow.