import { USE_PATIENT_RECORDS_MOCK } from '../constants';
import type { PatientRecordsApi } from '../types';
import { patientRecordsClientApi } from './clientApi';
import { patientRecordsMockApi } from './mockApi';

/**
 * The selected `PatientRecordsApi` implementation — the single seam the hooks import. Selection is by config
 * (`USE_PATIENT_RECORDS_MOCK`), never by scattered `if (mock)` checks. Mock-primary this phase (the
 * family-owned record + access check are REQ-027 gaps; the visit-note history/append are real b14).
 */
export const patientRecordsApi: PatientRecordsApi = USE_PATIENT_RECORDS_MOCK
  ? patientRecordsMockApi
  : patientRecordsClientApi;
