frontend phase 15

This commit is contained in:
hamid
2026-07-10 20:28:06 +03:30
parent bc51cf59b4
commit 70cf00ce4a
151 changed files with 10711 additions and 44 deletions
+39
View File
@@ -0,0 +1,39 @@
/**
* When true, the admin domain is served by the in-memory mock (`apis/mockApi.ts`) behind the `AdminApi`
* seam. **Mock is primary this phase:** the b1 config/holiday/audit/support-alert endpoints are live and
* the real `clientApi.ts` maps them 1:1, but (a) config `updatedAt/updatedBy` and the actor/action/date
* audit filters aren't on the wire yet (REQ-029/030) and (b) the RBAC role endpoints don't exist in the
* b15 contract at all (REQ-031). The mock supplies a realistic, filter-exercising world for every console;
* flip to `false` per area once each upstream is complete — the swap is the one line in `apis/index.ts`.
*/
export const USE_ADMIN_MOCK = true;
/** Worklist page sizes (api-conventions `pageSize`, default 50 / max 100). */
export const ADMIN_PAGE_SIZE = 20;
export const AUDIT_PAGE_SIZE = 25;
/**
* Config + holidays are near-static reference data — a long `staleTime` avoids refetching on revisit; a
* mutation invalidates the relevant key so the change shows immediately. Audit + support-alerts move at
* ops speed (moderate staleness). All are gc'd after a few minutes off-screen.
*/
export const ADMIN_CONFIG_STALE_TIME = 5 * 60 * 1000;
export const ADMIN_HOLIDAYS_STALE_TIME = 5 * 60 * 1000;
export const ADMIN_AUDIT_STALE_TIME = 30 * 1000;
export const ADMIN_ALERTS_STALE_TIME = 20 * 1000;
export const ADMIN_GC_TIME = 5 * 60 * 1000;
/** Config keys that are **rates** and must validate to the closed-open interval [0, 1). */
export const RATE_CONFIG_KEYS: readonly string[] = [
'platform_fee_rate',
'vat_rate',
];
/** Grouping of config keys into UI sections (any key not listed falls into "other"). */
export const CONFIG_GROUPS: Record<string, readonly string[]> = {
fees: ['platform_fee_rate', 'vat_rate'],
deadlines: ['dispute_window_hours', 'nurse_payout_interval_days', 'payout_satna_threshold_irr', 'booking_request_response_deadline_minutes', 'payment_window_minutes'],
evv: ['evv_location_tolerance_meters'],
bnpl: ['bnpl_provider_enabled', 'bnpl_min_amount_irr'],
cancellation: ['cancellation_tier1_refund_rate', 'cancellation_tier2_refund_rate', 'cancellation_tier3_refund_rate'],
};