/**
 * 营销中心路由配置
 *
 * 【统一入口说明】
 * - /marketing/activity  : 统一活动管理入口
 *   支持类型：1-首单立减 2-优惠折扣 3-商品满减 4-邀请有礼
 *   后端通过 UnifiedActivityService 根据 activityType 分发到对应 Service
 *
 * 【小程序端 API】
 * - /invite/*             : 小程序端专属接口（haha-miniapp 模块的 InviteController）
 */

export default {
  path: "/marketing",
  redirect: "/marketing/activity",
  meta: {
    icon: "ri:megaphone-line",
    title: "营销中心",
    rank: 8,
    roles: ["admin", "operator"]
  },
  children: [
    {
      path: "/marketing/activity",
      name: "MarketingActivity",
      component: () => import("@/views/marketing/activity/index.vue"),
      meta: {
        icon: "ri:calendar-event-line",
        title: "活动管理"
      }
    },
    {
      path: "/marketing/coupon",
      name: "MarketingCoupon",
      component: () => import("@/views/marketing/coupon/index.vue"),
      meta: {
        icon: "ri:coupon-3-line",
        title: "优惠券管理"
      }
    },
    {
      path: "/marketing/user-coupon",
      name: "UserCouponList",
      component: () => import("@/views/marketing/user-coupon/index.vue"),
      meta: {
        icon: "ri:ticket-line",
        title: "用户优惠券"
      }
    },
    {
      path: "/marketing/timed-discount",
      name: "TimedDiscount",
      component: () => import("@/views/timed-discount/index.vue"),
      meta: {
        icon: "ri:discount-percent-line",
        title: "定时折扣"
      }
    },
    {
      path: "/marketing/statistics",
      name: "MarketingStatistics",
      component: () => import("@/views/marketing/statistics/index.vue"),
      meta: {
        icon: "ri:bar-chart-line",
        title: "数据统计"
      },
      children: [
        {
          path: "/marketing/statistics/overview",
          name: "StatisticsOverview",
          component: () => import("@/views/marketing/statistics/overview.vue"),
          meta: {
            title: "统计概览"
          }
        },
        {
          path: "/marketing/statistics/activity",
          name: "ActivityStatistics",
          component: () => import("@/views/marketing/statistics/activity.vue"),
          meta: {
            title: "活动统计"
          }
        },
        {
          path: "/marketing/statistics/coupon",
          name: "CouponStatistics",
          component: () => import("@/views/marketing/statistics/coupon.vue"),
          meta: {
            title: "优惠券统计"
          }
        },
        {
          path: "/marketing/statistics/trend",
          name: "TrendAnalysis",
          component: () => import("@/views/marketing/statistics/trend.vue"),
          meta: {
            title: "趋势分析"
          }
        }
      ]
    }
  ]
} satisfies RouteConfigsTable;
