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

const prefix = 'order-detail/';
/**
 * 分页查询订单详情列表
 * @param data
 */
export async function getOrderDetailListApi(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 获取订单详情下拉列表
 */
export async function getOrderDetailOptionApi() {
  return requestClient.get<any>(`${prefix}option`);
}

/**
 * 获取订单详情详情
 * @param id
 */
export async function getOrderDetailInfoApi(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增订单详情
 * @param data
 */
export async function createOrderDetailApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑订单详情
 * @param data
 */
export async function updateOrderDetailApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除订单详情
 * @param data
 */
export async function deleteOrderDetailApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
