/**
 * 商品总库 API
 */

import { get, post } from '@/utils/request';

export interface MasterProductQueryParams {
  page?: number;
  pageSize?: number;
  barcode?: string;
  code?: string;
  productName?: string;
  deviceAdapt?: string;
}

export interface MasterProductListResponse {
  list: any[];
  total: number;
  pageSize: number;
  currentPage: number;
}

/** 获取商品总库列表 */
export function getMasterProductList(params: MasterProductQueryParams): Promise<MasterProductListResponse> {
  return get('/products/master/list', params);
}

/** 将总库商品加入商户商品库 */
export function addToMerchantProducts(data: { codeList: string }): Promise<any> {
  return post('/products/master/add-to-merchant', data);
}
