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

const prefix = 'special-prescription-category/';

export async function getSpecialPrescriptionCategoryList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

export async function getSpecialPrescriptionCategoryOption(data?: any) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}

export async function getSpecialPrescriptionCategoryInfo(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

export async function createSpecialPrescriptionCategory(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

export async function updateSpecialPrescriptionCategory(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

export async function deleteSpecialPrescriptionCategory(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}

export async function updateSpecialPrescriptionCategorySortOrder(data: { ids: number[] }) {
  return requestClient.post<any>(`${prefix}update-sort-order`, data);
}
