46 lines
2.4 KiB
TypeScript
46 lines
2.4 KiB
TypeScript
/**
|
|
* When true, the verification domain is served by the in-memory mock (apis/mockApi.ts) behind the
|
|
* VerificationApi seam. The b6 routes exist server-side, but — like `catalog` — the mock lets the full
|
|
* nurse flow (checklist → identity run → credential upload → under-review → admin-approval → verified
|
|
* badge + publish gate) demo standalone before the backend is reachable in this environment. Flip to
|
|
* false to hit the live endpoints — no hook/component changes (see
|
|
* dev/shared-working-context/reports/mocks-registry.md).
|
|
*/
|
|
export const USE_VERIFICATION_MOCK = true;
|
|
|
|
/**
|
|
* The checklist is **moderately fresh** — submitting a step changes it, and every mutation invalidates
|
|
* it, so a short staleTime avoids a refetch when B3 and B6 mount from the same cached query.
|
|
*/
|
|
export const VERIFICATION_STATUS_STALE_TIME = 30_000;
|
|
|
|
/** The public trust badge changes only on a step decision / suspension / expiry — keep it warm longer. */
|
|
export const TRUST_BADGE_STALE_TIME = 5 * 60_000; // 5 min
|
|
export const TRUST_BADGE_GC_TIME = 30 * 60_000; // 30 min
|
|
|
|
/** Client-side document guardrails (mirrors the b6 `IObjectStorage` limits). jpg/png/pdf, 5 MB cap. */
|
|
export const ACCEPTED_DOCUMENT_TYPES: readonly string[] = ['image/jpeg', 'image/png', 'application/pdf'] as const;
|
|
export const ACCEPTED_IMAGE_TYPES: readonly string[] = ['image/jpeg', 'image/png'] as const;
|
|
export const MAX_DOCUMENT_SIZE_BYTES = 5 * 1024 * 1024; // 5 MB
|
|
|
|
/** The national-ID is a 10-digit code with an official checksum — validated before the KYC run. */
|
|
export const NATIONAL_ID_LENGTH = 10;
|
|
|
|
/**
|
|
* Admin review queue — moderately fresh; a decision invalidates it. `keepPreviousData` + a per-page key
|
|
* make paging flicker-free, so a short `staleTime` is enough.
|
|
*/
|
|
export const ADMIN_QUEUE_STALE_TIME = 20_000;
|
|
export const ADMIN_QUEUE_PAGE_SIZE = 20;
|
|
|
|
/** A single admin case — same freshness as the queue; invalidated on every decide / approve / reject. */
|
|
export const ADMIN_CASE_STALE_TIME = 20_000;
|
|
|
|
/**
|
|
* A document's **signed GET URL is short-lived** (server issues ~60 s URLs). Fetch it on demand and keep it
|
|
* out of long-term cache: a short `staleTime` re-fetches a fresh URL on reopen; a short `gcTime` drops the
|
|
* stale URL soon after the viewer closes (never retry — a failed/expired sign is surfaced, not re-hammered).
|
|
*/
|
|
export const SIGNED_DOCUMENT_URL_STALE_TIME = 30_000;
|
|
export const SIGNED_DOCUMENT_URL_GC_TIME = 60_000;
|