import { requestClient } from '#/api/request';

export interface FormMetaListItem {
  id: string;
  application_id?: string;
  application_name?: string;
  application_code?: string;
  name: string;
  code: string;
  status: string;
}

export interface FormListParams {
  page?: number;
  pageSize?: number;
  applicationId?: string;
  name?: string;
  code?: string;
  status?: string;
  includeGloballyVisible?: boolean;
}

interface FormPaginatedResponse<T> {
  items: T[];
  total: number;
  page: number;
  pageSize: number;
}

export async function getFormListApi(params?: FormListParams) {
  return requestClient.get<FormPaginatedResponse<FormMetaListItem>>(
    '/api/ai/forms/list',
    { params },
  );
}
