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

const prefix = 'delivery-warehouse-product/';

/**
 * 平台仓品审核列表
 * audit_status 为空时后端默认只返回待审
 */
export async function getDeliveryWarehouseProductAuditList(data: any) {
  return requestClient.get<any>(`${prefix}audit-list`, { params: data });
}

/**
 * 仓品详情（审核弹窗展示）
 */
export async function getDeliveryWarehouseProductInfo(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 平台审核（一次提交）：
 * 主数据审过 + 总仓供货价/售价同步门店 + 绑仓三费 + 可选初始入库
 */
export async function auditDeliveryWarehouseProduct(data: {
  id: number;
  status: 2 | 3;
  zone_id: number;
  category_id?: number;
  drug_number: string;
  market_price: number;
  price: number;
  quote: number;
  promo_fee: number;
  platform_fee: number;
  initial_stock?: number;
}) {
  return requestClient.post<any>(`${prefix}audit`, data);
}
