export interface DemoProductRequirement {
  id: string;
  title: string;
  status: '待评审' | '设计中' | '开发中' | '验证中' | '已完成';
  priority: 'P0' | 'P1' | 'P2';
  owner: string;
  module: string;
  updatedAt: string;
}

export interface DemoProductRoadmapItem {
  id: string;
  title: string;
  window: string;
  status: '已排期' | '推进中' | '风险关注';
  summary: string;
}

export type DemoProductManageStatus = '启用产品' | '归档产品' | '暂停产品' | '废弃产品';

export interface DemoProduct {
  id: string;
  name: string;
  code: string;
  owner: string;
  department: string;
  status: '规划中' | '研发中' | '稳定运营';
  manageStatus: DemoProductManageStatus;
  stage: '探索' | '增长' | '平台化';
  version: string;
  releaseTarget: string;
  updatedAt: string;
  health: '健康' | '关注' | '加速';
  summary: string;
  tags: string[];
  teamCount: number;
  requirementCount: number;
  bugCount: number;
  focus: string[];
  requirements: DemoProductRequirement[];
  roadmap: DemoProductRoadmapItem[];
}

export const demoProducts: DemoProduct[] = [
  {
    id: 'product-alpha',
    name: '产品中台 Alpha',
    code: 'ALPHA',
    owner: '林语辰',
    department: '平台产品部',
    status: '研发中',
    manageStatus: '启用产品',
    stage: '平台化',
    version: 'v2.8.0',
    releaseTarget: '2026-05-10',
    updatedAt: '2026-04-16',
    health: '健康',
    summary: '面向多业务线复用的产品主数据与流程配置中台，当前重点在规则编排和版本发布节奏收口。',
    tags: ['平台能力', '规则编排', '统一发布'],
    teamCount: 14,
    requirementCount: 26,
    bugCount: 5,
    focus: ['统一配置台账', '版本灰度策略', '对象权限接入'],
    requirements: [
      {
        id: 'REQ-101',
        title: '支持产品对象上下文的头部导航切换',
        status: '开发中',
        priority: 'P0',
        owner: '赵明远',
        module: '工作台',
        updatedAt: '2026-04-15'
      },
      {
        id: 'REQ-108',
        title: '接入对象成员角色模板的快捷查看',
        status: '设计中',
        priority: 'P1',
        owner: '姜知夏',
        module: '权限',
        updatedAt: '2026-04-13'
      },
      {
        id: 'REQ-112',
        title: '支持发布包差异对比摘要',
        status: '待评审',
        priority: 'P1',
        owner: '周承安',
        module: '发布',
        updatedAt: '2026-04-11'
      }
    ],
    roadmap: [
      {
        id: 'RM-1',
        title: '对象上下文导航试点',
        window: '2026 Q2',
        status: '推进中',
        summary: '先在产品域打通对象入口、头部导航、按钮权限隔离。'
      },
      {
        id: 'RM-2',
        title: '规则编排配置台账',
        window: '2026 Q2',
        status: '已排期',
        summary: '把历史分散配置统一归档到产品规则台账。'
      },
      {
        id: 'RM-3',
        title: '发布治理看板',
        window: '2026 Q3',
        status: '风险关注',
        summary: '依赖后端事件流与测试数据沉淀，排期受联调进度影响。'
      }
    ]
  },
  {
    id: 'product-orbit',
    name: 'Orbit 客户协同端',
    code: 'ORBIT',
    owner: '程清和',
    department: '客户体验部',
    status: '稳定运营',
    manageStatus: '归档产品',
    stage: '增长',
    version: 'v1.9.3',
    releaseTarget: '2026-04-28',
    updatedAt: '2026-04-14',
    health: '关注',
    summary: '围绕客户协同与交付反馈的门户产品，近期重点是降低工单回流和优化首屏转化链路。',
    tags: ['客户协同', '交付门户', '反馈闭环'],
    teamCount: 10,
    requirementCount: 18,
    bugCount: 9,
    focus: ['首屏引导改版', '交付看板合并', '通知触达回收'],
    requirements: [
      {
        id: 'REQ-203',
        title: '重构客户交付看板首页信息密度',
        status: '验证中',
        priority: 'P0',
        owner: '顾思远',
        module: '门户',
        updatedAt: '2026-04-15'
      },
      {
        id: 'REQ-217',
        title: '补充客户联系人生命周期标签',
        status: '开发中',
        priority: 'P1',
        owner: '何嘉宁',
        module: '客户画像',
        updatedAt: '2026-04-12'
      }
    ],
    roadmap: [
      {
        id: 'RM-4',
        title: '客户首页分群策略升级',
        window: '2026 Q2',
        status: '推进中',
        summary: '把静态首页切分为按客户阶段动态呈现的版本。'
      },
      {
        id: 'RM-5',
        title: '交付反馈闭环自动催办',
        window: '2026 Q3',
        status: '已排期',
        summary: '通过规则任务减少人工跟进成本。'
      }
    ]
  },
  {
    id: 'product-lighthouse',
    name: 'Lighthouse 经营驾驶舱',
    code: 'LIGHT',
    owner: '宋知序',
    department: '商业产品部',
    status: '稳定运营',
    manageStatus: '启用产品',
    stage: '增长',
    version: 'v3.2.1',
    releaseTarget: '2026-05-22',
    updatedAt: '2026-04-15',
    health: '健康',
    summary: '承接经营看板、指标订阅和异常播报的统一产品驾驶舱，当前聚焦跨部门指标口径收敛与高频场景提效。',
    tags: ['经营分析', '指标订阅', '统一驾驶舱'],
    teamCount: 12,
    requirementCount: 21,
    bugCount: 3,
    focus: ['指标口径治理', '异常订阅编排', '高层驾驶舱视图'],
    requirements: [
      {
        id: 'REQ-221',
        title: '支持核心经营指标的口径版本管理',
        status: '开发中',
        priority: 'P0',
        owner: '孟之遥',
        module: '指标中心',
        updatedAt: '2026-04-14'
      },
      {
        id: 'REQ-228',
        title: '补齐驾驶舱异常波动播报模板',
        status: '待评审',
        priority: 'P1',
        owner: '韩屿川',
        module: '播报',
        updatedAt: '2026-04-11'
      }
    ],
    roadmap: [
      {
        id: 'RM-8',
        title: '经营指标主题化看板升级',
        window: '2026 Q2',
        status: '推进中',
        summary: '将现有指标页按经营主题重组，减少跨页面跳转成本。'
      }
    ]
  },
  {
    id: 'product-pulse',
    name: 'Pulse 消息协同台',
    code: 'PULSE',
    owner: '许闻洲',
    department: '协同平台部',
    status: '规划中',
    manageStatus: '启用产品',
    stage: '探索',
    version: 'v0.6.4',
    releaseTarget: '2026-05-30',
    updatedAt: '2026-04-13',
    health: '关注',
    summary: '统一承接站内消息、流程通知与消息编排的试点产品，当前重点是通知模板复用与多渠道触达一致性。',
    tags: ['消息编排', '流程通知', '多渠道触达'],
    teamCount: 7,
    requirementCount: 13,
    bugCount: 2,
    focus: ['模板复用', '渠道一致性', '消息审计留痕'],
    requirements: [
      {
        id: 'REQ-331',
        title: '梳理流程类通知的统一模板规范',
        status: '设计中',
        priority: 'P1',
        owner: '丁和畅',
        module: '模板中心',
        updatedAt: '2026-04-12'
      }
    ],
    roadmap: [
      {
        id: 'RM-9',
        title: '流程消息中心试点',
        window: '2026 Q2',
        status: '已排期',
        summary: '先打通审批、告警两条主链路，验证模板与渠道编排能力。'
      }
    ]
  },
  {
    id: 'product-nova',
    name: 'Nova 数据服务台',
    code: 'NOVA',
    owner: '陆闻笙',
    department: '数据中台部',
    status: '研发中',
    manageStatus: '暂停产品',
    stage: '探索',
    version: 'v0.9.0',
    releaseTarget: '2026-06-18',
    updatedAt: '2026-04-12',
    health: '加速',
    summary: '承接跨系统数据接入、数据模型装配与查询服务的试点产品，当前仍在能力边界探索阶段。',
    tags: ['数据服务', '模型装配', '试点产品'],
    teamCount: 8,
    requirementCount: 11,
    bugCount: 4,
    focus: ['接入链路模板化', '查询 SLA 监控', '多租户样例沉淀'],
    requirements: [
      {
        id: 'REQ-301',
        title: '沉淀数据接入模板库',
        status: '开发中',
        priority: 'P0',
        owner: '沈南舟',
        module: '接入',
        updatedAt: '2026-04-16'
      },
      {
        id: 'REQ-306',
        title: '接入失败告警卡片化展示',
        status: '设计中',
        priority: 'P2',
        owner: '夏安宁',
        module: '监控',
        updatedAt: '2026-04-10'
      }
    ],
    roadmap: [
      {
        id: 'RM-6',
        title: '试点租户接入扩容',
        window: '2026 Q2',
        status: '推进中',
        summary: '把当前 2 个试点租户扩到 6 个，验证模型复用率。'
      }
    ]
  },
  {
    id: 'product-atlas',
    name: 'Atlas 组织配置台',
    code: 'ATLAS',
    owner: '冯见山',
    department: '企业应用部',
    status: '稳定运营',
    manageStatus: '归档产品',
    stage: '平台化',
    version: 'v2.6.8',
    releaseTarget: '2026-02-28',
    updatedAt: '2026-04-09',
    health: '健康',
    summary: '曾用于统一组织架构、岗位映射和通讯录同步的配置平台，现已完成能力迁移，仅作为历史归档保留。',
    tags: ['组织配置', '历史归档', '同步映射'],
    teamCount: 6,
    requirementCount: 8,
    bugCount: 0,
    focus: ['历史配置追溯', '迁移审计', '只读查询'],
    requirements: [
      {
        id: 'REQ-510',
        title: '补充组织配置迁移后的审计说明',
        status: '已完成',
        priority: 'P2',
        owner: '罗听雪',
        module: '审计',
        updatedAt: '2026-04-06'
      }
    ],
    roadmap: [
      {
        id: 'RM-10',
        title: '归档访问范围收口',
        window: '2026 Q2',
        status: '已排期',
        summary: '控制仅审计角色可访问历史配置详情，普通角色只看摘要。'
      }
    ]
  },
  {
    id: 'product-sprint',
    name: 'Sprint 交付排期台',
    code: 'SPRINT',
    owner: '魏书言',
    department: '交付效能部',
    status: '研发中',
    manageStatus: '暂停产品',
    stage: '增长',
    version: 'v1.3.0',
    releaseTarget: '2026-06-08',
    updatedAt: '2026-04-08',
    health: '关注',
    summary: '面向交付里程碑排期、风险跟踪和协作节奏对齐的产品，当前因上游流程调整进入阶段性暂停。',
    tags: ['交付排期', '风险跟踪', '协作节奏'],
    teamCount: 9,
    requirementCount: 15,
    bugCount: 6,
    focus: ['排期模板统一', '跨团队风险同步', '里程碑预警'],
    requirements: [
      {
        id: 'REQ-612',
        title: '梳理暂停期间保留的风险同步能力范围',
        status: '待评审',
        priority: 'P1',
        owner: '徐青禾',
        module: '风险中心',
        updatedAt: '2026-04-07'
      }
    ],
    roadmap: [
      {
        id: 'RM-11',
        title: '暂停期能力边界梳理',
        window: '2026 Q2',
        status: '风险关注',
        summary: '待交付流程新方案确定后，再决定是否恢复后续迭代。'
      }
    ]
  },
  {
    id: 'product-legacy',
    name: 'Legacy 营销活动台',
    code: 'LEGACY',
    owner: '陈念初',
    department: '增长运营部',
    status: '稳定运营',
    manageStatus: '废弃产品',
    stage: '增长',
    version: 'v3.4.1',
    releaseTarget: '2026-03-18',
    updatedAt: '2026-03-25',
    health: '关注',
    summary: '面向历史营销活动配置与投放归档的旧产品，目前仅保留数据查询和审计访问能力，不再纳入持续建设计划。',
    tags: ['历史归档', '活动投放', '审计留痕'],
    teamCount: 5,
    requirementCount: 6,
    bugCount: 1,
    focus: ['历史活动追溯', '旧投放数据迁移', '权限范围收敛'],
    requirements: [
      {
        id: 'REQ-401',
        title: '补充历史活动包的只读访问说明',
        status: '已完成',
        priority: 'P2',
        owner: '白昭宁',
        module: '审计',
        updatedAt: '2026-03-20'
      }
    ],
    roadmap: [
      {
        id: 'RM-7',
        title: '历史活动数据归档收尾',
        window: '2026 Q1',
        status: '已排期',
        summary: '只保留审计查询链路，后续不再承接新的活动能力建设。'
      }
    ]
  }
];

export function getDemoProductById(productId: string) {
  return demoProducts.find(item => item.id === productId) || null;
}

export function getProductStatusType(status: DemoProduct['status']) {
  const statusTypeMap: Record<DemoProduct['status'], 'success' | 'warning' | 'info'> = {
    规划中: 'info',
    研发中: 'warning',
    稳定运营: 'success'
  };

  return statusTypeMap[status];
}

export function getProductHealthType(health: DemoProduct['health']) {
  const healthTypeMap: Record<DemoProduct['health'], 'success' | 'warning' | 'danger'> = {
    健康: 'success',
    关注: 'warning',
    加速: 'danger'
  };

  return healthTypeMap[health];
}
