import { http } from "@/utils/http";

type Result = {
  code: number;
  message: string;
  data?: any;
};

/** 从 ERP 同步店铺数据 */
export const syncErpShops = () =>
  http.request<Result>("post", "/erp-shops/sync");

/** 获取已缓存的 ERP 店铺列表 */
export const getErpShopList = () =>
  http.request<Result>("get", "/erp-shops");

/** 绑定门店与 ERP 店铺 */
export const bindErpShop = (shopId: number, erpShopId: number) =>
  http.request<Result>("post", "/erp-shops/bind", { data: { shopId, erpShopId } });

/** 解除门店与 ERP 店铺的绑定 */
export const unbindErpShop = (shopId: number) =>
  http.request<Result>("post", "/erp-shops/unbind", { data: { shopId } });
