// STUB — see DMS/pages/_shared/utils.ts. DMS HTTP client, not migrated.
// Returns empty payloads so any DMS call degrades to "no results" rather than
// crashing. Wire the real @/DMS/api/dms.http if DMS is brought over.

function warn(method: string, url: string) {
  // eslint-disable-next-line no-console
  console.warn(`[DMS stub] ${method} ${url} — DMS is not migrated; returning empty.`);
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function empty<T = any>(): Promise<{ data: T }> {
  return { data: {} as T };
}

export const dmsHttp = {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  get: <T = any>(url: string): Promise<{ data: T }> => (warn("GET", url), empty<T>()),
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  post: <T = any>(url: string): Promise<{ data: T }> => (warn("POST", url), empty<T>()),
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  put: <T = any>(url: string): Promise<{ data: T }> => (warn("PUT", url), empty<T>()),
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  delete: <T = any>(url: string): Promise<{ data: T }> => (warn("DELETE", url), empty<T>()),
};
