/**
 * 仪表盘统计 API
 *
 * ⚠️ 后端目前**没有** dashboard 模块（后端 module 目录 14 个：address/admin/banner/cart/category/chat/coupon/favorite/file/notice/order/product/seckill/user，不含 dashboard）
 *
 * 因此下面的端点为预留路径，调用必然 404。等后端补 DashboardController 后即可启用。
 * 建议后端提供：
 *   GET /api/admin/dashboard/stats        → 今日订单/销售额/用户数/商品数
 *   GET /api/admin/dashboard/sales-trend  → {date, amount}[]
 *   GET /api/admin/dashboard/order-status→ {name, value}[]
 *   GET /api/admin/dashboard/hot-products → {name, sales}[]
 *
 * 当前用法：视图层捕获 404 并展示"暂无数据"。
 */

export interface DashboardStats {
  todayOrders: number
  todaySales: number
  totalUsers: number
  totalProducts: number
}

export function getDashboardStatsApi() {
  // 后端未提供，先返回 stub。视图层应使用单独的 mock 或空数据兜底
  return Promise.resolve({
    todayOrders: 0,
    todaySales: 0,
    totalUsers: 0,
    totalProducts: 0
  } as DashboardStats)
}

export function getSalesTrendApi(_days: number) {
  return Promise.resolve([] as { date: string; amount: number }[])
}

export function getOrderStatusDistributionApi() {
  return Promise.resolve([] as { name: string; value: number }[])
}

export function getHotProductsApi() {
  return Promise.resolve([] as { name: string; sales: number }[])
}
