export interface AdminFulfillmentRoutingExecutorConfig {
  enabled: boolean
}

export interface AdminFulfillmentRoutingRule {
  id: string
  enabled: boolean
  productName: string
  normalizedProductName: string
  matchType: 'exact' | 'contains'
  executorKey: string
  priority: number
  notes: string
}

export interface AdminFulfillmentRoutingConfig {
  filePath: string
  enabled: boolean
  defaultExecutorPriority: string[]
  unmatchedExecutorKey: string
  executors: Record<string, AdminFulfillmentRoutingExecutorConfig>
  rules: AdminFulfillmentRoutingRule[]
}

export interface AdminFulfillmentRoutingPreviewResult {
  productName: string
  normalizedProductName: string
  resolvedSkuCode: string
  resolvedSkuName: string
  isConfigured: boolean
  fulfillmentRoute: null | {
    selectedExecutorKey: string
    selectedRuleId: string
    reason: string
    matchedRule: null | {
      id: string
      productName: string
      executorKey: string
      priority: number
    }
    candidates: Array<{
      executorKey: string
      available: boolean
      reason?: string
    }>
    skipped: Array<{
      executorKey: string
      reason: string
    }>
  }
  cloudtentacles: Record<string, unknown> | null
  kuaishouFeifei: Record<string, unknown> | null
}
