frontend phase 13
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* When true, the reviews domain is served by the in-memory mock (`apis/mockApi.ts`) behind the `ReviewsApi`
|
||||
* seam.
|
||||
*
|
||||
* **Mock is primary this phase.** b14 serves the review **submit**, the public **nurse reviews** page, and
|
||||
* the tag rollup — but there is **no** review-eligibility read and **no** my-review-for-booking read
|
||||
* (**REQ-026**), and the whole moderation transition (`pending_moderation → published`) is admin-only (f15).
|
||||
* The mock reads the shared **f8 bookings store** to gate eligibility on a completed booking, tracks the
|
||||
* customer's submission so the "under review" state persists, seeds a small published-review list per nurse
|
||||
* for the profile tab, and exposes a dev-only `__mockPublishSubmittedReview` so a human can watch a submitted
|
||||
* review appear on the profile (the f15 moderation UI is deferred). Flip to `false` once REQ-026 lands — no
|
||||
* hook/component change (only `clientApi.ts`'s two gap methods start returning real data).
|
||||
*/
|
||||
export const USE_REVIEWS_MOCK = true;
|
||||
|
||||
/** Page size for the public nurse-reviews list (api-conventions `pageSize`). */
|
||||
export const REVIEWS_PAGE_SIZE = 5;
|
||||
|
||||
/**
|
||||
* The published-review list moves slowly (a moderation transition is a rare admin action) — a generous
|
||||
* `staleTime` means revisiting a profile never needlessly refetches. Eligibility/my-review are per-booking
|
||||
* and are **invalidated on submit**, so their staleness is short (a submit must flip the CTA immediately).
|
||||
*/
|
||||
export const NURSE_REVIEWS_STALE_TIME = 2 * 60 * 1000;
|
||||
export const REVIEW_ELIGIBILITY_STALE_TIME = 30 * 1000;
|
||||
export const REVIEWS_GC_TIME = 10 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* The low-rating support-alert threshold (server config, default ≤ 2). The mock echoes it on
|
||||
* `SubmitReviewResult.lowRatingAlertRaised`; the **UI never surfaces it** — it exists only so the mock's
|
||||
* result shape matches the wire.
|
||||
*/
|
||||
export const MIN_RATING_FOR_SUPPORT_ALERT = 2;
|
||||
Reference in New Issue
Block a user