export interface AdminKuaishouFeifeiProductRule {
  id: string
  enabled: boolean
  productName: string
  normalizedProductName: string
  productCode: string
  skuName: string
  notes: string
}

export interface AdminKuaishouFeifeiConfig {
  enabled: boolean
  baseUrl: string
  appKey: string
  appSecret: string
  timeoutMs: number
  notifyUrl: string
  productRules: AdminKuaishouFeifeiProductRule[]
}

export interface AdminKuaishouFeifeiEffectiveConfig {
  enabled: boolean
  baseUrl: string
  timeoutMs: number
  notifyUrl: string
  hasAppKey: boolean
  hasAppSecret: boolean
  productRuleCount: number
}

export interface AdminKuaishouFeifeiConfigResponse {
  filePath: string
  source: AdminKuaishouFeifeiConfig
  effective: AdminKuaishouFeifeiEffectiveConfig
}

export interface AdminKuaishouFeifeiProductSyncResult extends AdminKuaishouFeifeiConfigResponse {
  sync: {
    productCount: number
    ruleCount: number
    status: string
    supplyProductName: string
  }
}

export interface AdminKuaishouFeifeiProductMatch {
  matchMode: string
  productName: string
  normalizedProductName: string
  productCode: string
  skuName: string
}

export interface AdminKuaishouFeifeiMatchResult {
  productName: string
  normalizedProductName: string
  matched: boolean
  match: AdminKuaishouFeifeiProductMatch | null
}

export interface AdminKuaishouFeifeiProductItem {
  productCode: string
  name: string
  channel: string
  externalProductId: string
  imageUrl: string
  status: string
  supplyStatus: string
  supplyPricePoints: number
  feePoints: number
  unitCostPoints: number
  maxOrderQuantity: number
  salePricePoints: number | null
  raw: Record<string, unknown>
}

export interface AdminKuaishouFeifeiProductListResult {
  items: AdminKuaishouFeifeiProductItem[]
  total: number
  page: number
  perPage: number
  raw: Record<string, unknown>
}

export interface AdminKuaishouFeifeiOrderResult {
  orderNo: string
  platformOrderNo: string
  productCode: string
  productName: string
  rechargeStatus: number
  rechargeStatusLabel: string
  pointsCharged: number
  playerAccount: string
  platformBuyNum: number
  rechargeResultMessage: string
  createdAt: string
  updatedAt: string
  rechargeFinishAt: string
  h5: {
    entryUrl: string
    rechargeUrl: string
  }
  raw: Record<string, unknown>
}
