import type { FormRules } from 'element-plus'

/**
 * shopList
 * 只是一个类型说明
 */
export default interface shopList {
  id: number,
  shopType: string,
  shopOpenId: string,
  shopCode: string,
  shopName: string,
  region: string,
  shopServiceCode: string,
  authorizeTime: Date | null
}

export interface warehouseList {
  warehouseId: string,
  name: string,
  type: string,
  isDefault: string,
  region: string,
  state: string,
  city: string,
  zip: string,
  address: string
}

export interface shopOrder {
  id: number,
  sellerShopId: number,  // 店铺id
  shopOpenId: string,  // 店铺的openid
  shopOrderId: string,  // 店铺的订单id
  shopServiceCode: string,
  toCountry: string,
  toEmail: string,
  toMobile: string,
  toFamilyName: string,
  toFirstName: string,
  toName: string,
  toAddress1: string,
  toAddress2: string,
  toRoom: string,
  toCity: string,
  toState: string,
  toZip: string,
  skuCount: number,
  totalCount: number,
  fromWarehouse: string,  // 店铺的仓库id
  shippingType: string,
  courier: string,
  orderStatus: string,
  orderTime: string,
  sellerShopName: string  // 店铺名称
}

export interface shopOrderDetailType {
  orderId: number,
  shopSpuId: string,
  shopSpuName: string,
  spuCode: string,
  shopSkuId: string,
  shopSkuName: string,
  skuCode: string,
  skuCount: number,
  status: string
}

export interface listedProductsType {
  mappingHash: string,         // 刊登产品的key，有些接口需要此key，比如同步库存到店铺
  spuCode: string,
  spuName: string,
  spuImage: string,
  shopName: string,
  shopServiceCode: string,
  shopServiceName: string,
  lastListingTime: string,
  status: string     
}


export interface shippingListType {
  shippingProductCode: string,         // 刊登产品的key，有些接口需要此key，比如同步库存到店铺
  shippingProductName: string,
}

export const listingRules = reactive<FormRules>({
  "shopId":[ { required: true, message: "店铺 必填", trigger: "change", }],
  "spuCode": [ { required: true, message: "SPU 必填", trigger: "blur", }],
  "shopWarehouseId": [{required: true, message: "仓库 必填", trigger: "change",}]
})