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

const prefix = 'delivery-warehouse/';

/**
 * 分页查询配送仓库列表
 */
export async function getDeliveryWarehouseList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 配送仓库下拉选项
 */
export async function getDeliveryWarehouseOption(data: any = {}) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}

/**
 * 获取配送仓库详情
 */
export async function getDeliveryWarehouseInfo(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增配送仓库
 */
export async function createDeliveryWarehouse(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑配送仓库
 */
export async function updateDeliveryWarehouse(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除配送仓库
 */
export async function deleteDeliveryWarehouse(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
