import { UploadFile } from 'antd/es/upload/interface';
// 商城-新增商品
import { InterFunction } from '~/api/interface';

//商品-新增
export type BaseInfoType = {
  goodsName: string;
  goodsDesc: string;
  directoryId: number;
  tag: string;
  shelfStatus: number;
  categoryByOne: number;
  categoryByTwo: number;
  images: { id: number; imgType: number; imgUrl: string }[];
  goodsVideo: string;
};
// 库存规格
export interface specEntity {
  id: number;
  categoryId: number | string;
  goodsSpecName: string;
  skuId: number;
  specIds: any;
  chooseType: number;
  must: number;
  skuUnitId: number;
  customizeInfo?: customizeEntity[];
  productSpecList?: customizeEntity[];
  industrySpecList?: any;
  isCustomProd: boolean;
  skuName?: string;
  flag: number;
  productName?: string;
}
// 自定义规格
export interface customizeEntity {
  id: number;
  partNo: string;
  specName: string;
  specImage?: string;
  fileList?: UploadFile[];
  productSpecCPQVO?: any;
  productSpec?: number;
}
export type addGoodsType = InterFunction<
  BaseInfoType & {
    productSpec: specEntity[];
    goodsDetailVO: { goodsDesc: string; productDesc?: string };
    otherService: number[];
  },
  any
>;
//商品-编辑
export type editGoodsType = InterFunction<
  BaseInfoType & {
    productSpec: specEntity[];
    goodsDetailVO: { goodsDesc: string; productDesc?: string };
    otherService: number[];
    id: number;
  },
  any
>;
//商品-详情
export type detailGoodsType = InterFunction<
  { goodsInfoId: number },
  BaseInfoType & {
    goodsSpec: specEntity[];
    goodsDetail: { goodsDesc: string; productDesc: string };
    otherService: number[];
    goodsVideoId: number;
    id: number;
  }
>;
//商品-其它服务列表
export type otherServiceType = InterFunction<any, { id: number; saleServiceName: string }[]>;
//商品-规格单位
export type skuUnitType = InterFunction<any, { id: number; unitName: string }[]>;
