export interface IntercategoryTree {
  count: number
  remark: string
  status: number | string
  children: IntercategoryTree[] | null
}
export interface InterSearchCriteria {
  category_id: number | null
  diyUserId: number | null
  name: string
  print_type: number | null
  product_type: string
  sku: string
}

// 需要 status 的场景
export interface InterSearchCriteriaWithStatus extends InterSearchCriteria {
  status: string
}
export interface InterCardItem {
  colorImageList: string[]
  remark: string
  cnRemark: string
  id: number
  sku: string
  product_no: string
  name: string
  namespace: string | null
  affiliated_factory: string | null
  third_sku: string | null
  title: string
  color_images: string
  img_url: string
  category_id: number
  weight: number
  purchasing_min: number | null
  factory_price: number
  sales_price: number
  sales_price_max: number
  status: number | string | null
  property1_cate_id: number
  property2_cate_id: number
  property3_cate_id?: number | null
  property1_enname: string
  property2_enname: string
  property3_enname?: string | null
  material: string
  print_type: number
  origin_code: string
  origin_name_cn: string
  origin_name_en: string
  currency_code: string
  currency_name: string
  product_type: string
  factory_id: number | null
  factory_code: string | null
  processing: boolean
  create_time: string
  update_time: string
  sort: number | null
  diy_id: number
  diy_sku: string
}
/** 图片信息 */
export interface ImageInfo {
  id: number | null
  product_id?: number | null
  image_url: string
  sort: number
  type?: number
  create_time?: string
}
/** 产品备注信息 */
export interface ProductRemark {
  id: number
  product_id: number
  remark: string // HTML格式
  create_time?: string
}
/** SKU属性值 */
export interface SkuPropertyValue {
  id: number
  cateCode: string
  cateName: string
  code: string
  cnname: string
  enname: string
  fontColor: string
  bgColor: string
  battery: boolean
  liquid: boolean
  knife: boolean
  selected: number
  sort: number
  enable: boolean
  publicData: boolean
  isCome?: number | null
}
/** SKU属性定义 */
export interface SkuProperty {
  id: number
  cnname: string
  enname: string
  sort: number
  skuProperty: boolean
  multi: boolean
  enable: boolean
  categoryInfoId: number | null
  propertyValueIds: number[] | null
  valueList: SkuPropertyValue[]
}
// 选中的sku
export interface InterSkuArr {
  id: number
  name: string
  enname: string
  valueList: SkuPropertyValue[]
  listCode: string[]
  selected?: number
}
/** 产品SKU */
export interface ProductSku {
  id: number
  product_id: number
  sku: string
  sku_name: string
  product_no: string
  image: string
  // image_ary: string // JSON字符串
  property_cate_id1: number
  property_cate_id2: number
  property_cate_id3: number | null
  property1_id: number
  property2_id: number
  property3_id: number | null
  property_code1: string
  property_code2: string
  property_code3: string | null
  option_enname1: string
  option_enname2: string
  option_enname3: string | null
  custom_value1: string
  custom_value2: string
  custom_value3: string | null
  factory_price: number
  sales_price: number
  sku_weight: number | null
  reg_count: number | null
  print_type?: number | null
  size_type?: number
  sort: number
  create_time?: string
  _X_ROW_KEY?: string | null
}
/** 属性关联 */
export interface PropertyRelation {
  id: number
  info_id: number
  property_id: number
  value_id: number
  sku_property: {
    type: 'Buffer'
    data: number[]
  }
}
// 编辑接口
export interface ProductDetail {
  // 图片相关
  colorImageList?: string[]
  color_images: string
  img_url: string
  imageList: ImageInfo[]
  sizeList: ImageInfo[]

  // 描述备注
  // remark: string // HTML格式
  cnRemark: string // HTML格式
  productRemark?: ProductRemark
  productCnRemark?: ProductRemark

  // 基础信息
  id: number | null
  sku?: string
  product_no: string
  name: string
  title: string
  userMark: string | null

  // 分类属性
  category_id: number | null
  property1_cate_id: number | null
  property2_cate_id: number | null
  property3_cate_id?: number | null
  property1_enname: string
  property2_enname: string
  property3_enname?: string | null

  // 价格重量
  weight: number | null
  factory_price: number | null
  sales_price?: number | null
  // sales_price_max?: number
  // purchasing_min?: number | null

  // 状态类型
  print_type: number | null
  product_type: 'platform' | 'customer' | string
  processing: boolean

  // 材质产地
  material: string
  // origin_code: string
  // origin_name_cn: string
  // origin_name_en: string

  // 货币
  currency_code: string
  currency_name: string

  // 工厂
  factory_id?: number | null
  factory_code?: string | null
  affiliated_factory?: string | null

  // DIY相关
  diy_id?: number
  diy_sku?: string
  diyUserIds?: number[]

  // 其他
  namespace: string | null
  third_sku?: string | null
  sort?: number | null
  create_time?: string
  update_time?: string

  // 工艺
  craftIds: string[]

  // 关联数据
  productList: ProductSku[]
  properties?: PropertyRelation[]
  skuProperties: SkuProperty[]
  factoryIds?: number[] | null
  // warehouseIds: number[]
}
export interface InterCategoryNode {
  id: number
  name: string
  enname: string
  pid: number
  pids: string
  deep: number
  sort: number
  enpath: string
  cnpath: string
  leaf: boolean
  createTime: string
  publicData?: boolean
  children?: InterCategoryNode[]
}
export interface InterCountryType {
  id: number
  nameCn: string
  nameEn: string
  countryCode: string
}
export interface InterCustomerItem {
  id: number
  name: string
  sku?: string
  user_mark?: string
}
export interface InterCraftItem {
  id: string
  craft_name: string
  craft_code: string
  craft_type: string
}
export interface CurrencyType {
  id: number
  currencyName: string
  currencyCode: string
}
export interface ProcessTypeData {
  label: string
  value: string
}
export interface InterProductType {
  name: string
  code: string
}
export interface UploadResponse {
  code: number
  requestId: string
  filePath: string
  message: string
}
export interface TableRowData {
  [key: string]: unknown
}
export interface InterReceiptItem {
  inNo: string
  warehouseId: string
  warehouseName: string
  remark: string
  factoryCode: string
  factoryId: number | null
  productList: ProductSku[]
}
