import type { AdminTaskListItem } from './tasks'

export interface AdminOrderFulfillmentProgress {
  totalTaskCount: number
  preparedTaskCount: number
  completedTaskCount: number
  resourceStatus: string
  customerStatus: string
}

export interface AdminOrderListItem {
  orderId: number
  provider: string
  platform: string
  shopId: string
  shopName: string
  platformOrderId: string
  orderStatus: string
  payStatus: string
  buyerId: string
  buyerName: string
  receiverContact: string
  totalAmount: string
  totalAmountFen: number
  currency: string
  paidAt: string | null
  createdAt: string
  updatedAt: string
  itemCount: number
  totalQuantity: number
  itemSummary: string
  taskCount: number
  resourceStatus: string
  customerStatus: string
  preparedTaskCount: number
  completedTaskCount: number
}

export interface AdminOrderDetail {
  order: {
    orderId: number
    provider: string
    platform: string
    shopId: string
    shopName: string
    platformOrderId: string
    orderStatus: string
    payStatus: string
    buyerId: string
    buyerName: string
    receiverContact: string
    totalAmount: string
    totalAmountFen: number
    currency: string
    paidAt: string | null
    createdAt: string
    updatedAt: string
    itemSummary: string
    rawPayload: Record<string, unknown>
    fulfillmentProgress: AdminOrderFulfillmentProgress
  }
  items: Array<{
    orderItemId: number
    skuCode: string
    skuName: string
    itemTitle: string
    quantity: number
    deliveryMode: string
    spec: Record<string, unknown>
  }>
  tasks: AdminTaskListItem[]
}
