/**
 * PR-37 Part A — Domain Knowledge Registry
 *
 * 行业知识库注册中心。16 个行业，每行业 10 个知识维度。
 *
 * 维度：
 *   1. Domain Name           — 行业名称
 *   2. Domain Description    — 行业描述
 *   3. Core Processes        — 核心业务流程
 *   4. Core Entities         — 核心业务实体
 *   5. Core Epics            — 核心 Epic 模板
 *   6. Core Features         — 核心 Feature 模板（按 Epic）
 *   7. Core KPIs             — 核心指标
 *   8. Core Roles            — 核心角色
 *   9. Industry Terminology  — 行业术语
 *  10. Industry Constraints  — 行业约束
 *  11. Industry Regulations  — 行业法规/合规
 *
 * @module pr-37-domain-intelligence/domain-registry
 * @since PR-37
 */

// ══════════════════════════════════════════════════════════
// Domain Registry Constants
// ══════════════════════════════════════════════════════════

export const DOMAIN_CATEGORY = {
  ENTERPRISE_SOFTWARE: "enterprise-software",
  INDUSTRIAL: "industrial",
  COMMERCE: "commerce",
  PLATFORM: "platform",
  INTELLIGENCE: "intelligence",
  ENGINEERING: "engineering",
  MANAGEMENT: "management",
};

// ══════════════════════════════════════════════════════════
// 16 Industry Domain Definitions
// ══════════════════════════════════════════════════════════

const DOMAINS = Object.freeze({

  // ──────────────────────────────────────
  // 1. ERP — Enterprise Resource Planning
  // ──────────────────────────────────────
  ERP: Object.freeze({
    name: "ERP",
    displayName: "企业资源计划",
    description: "整合企业核心业务流程（财务、采购、库存、生产、销售、人力）的一体化管理系统",
    category: DOMAIN_CATEGORY.ENTERPRISE_SOFTWARE,
    keywords: ["ERP", "企业资源计划", "财务", "采购", "库存", "进销存", "供应链", "MRP", "MRP II"],
    aliases: ["ERP系统", "企业ERP", "资源管理系统"],
    coreProcesses: [
      "采购到付款 (Procure-to-Pay)",
      "订单到收款 (Order-to-Cash)",
      "计划到生产 (Plan-to-Produce)",
      "记录到报告 (Record-to-Report)",
      "招聘到退休 (Hire-to-Retire)",
      "资产购置到报废 (Acquire-to-Retire)",
    ],
    coreEntities: [
      "会计科目", "凭证", "账簿", "财务报表",
      "采购订单", "入库单", "供应商", "应付账款",
      "物料", "BOM", "工单", "工艺路线", "工作中心",
      "销售订单", "出库单", "客户", "应收账款",
      "固定资产", "折旧", "成本中心", "利润中心",
      "员工", "部门", "岗位", "薪酬", "考勤",
    ],
    coreEpics: [
      { title: "财务管理", category: "财务管理", objective: "全面的财务核算与管控体系", successMetric: "月结时间缩短 50%" },
      { title: "采购管理", category: "采购管理", objective: "端到端采购流程自动化", successMetric: "采购周期缩短 30%" },
      { title: "库存管理", category: "库存管理", objective: "精准库存控制与优化", successMetric: "库存周转率提升 25%" },
      { title: "销售管理", category: "销售管理", objective: "从报价到回款全流程管理", successMetric: "订单处理效率提升 40%" },
      { title: "生产管理", category: "生产管理", objective: "生产计划与执行一体化", successMetric: "计划达成率 ≥ 95%" },
      { title: "成本管理", category: "成本管理", objective: "精细化成本核算与控制", successMetric: "成本核算准确率 ≥ 98%" },
      { title: "固定资产管理", category: "资产管理", objective: "资产全生命周期管理", successMetric: "资产利用率提升 20%" },
      { title: "供应链管理", category: "供应链管理", objective: "端到端供应链协同", successMetric: "供应链响应时间缩短 35%" },
      { title: "人力资源管理", category: "人力资源", objective: "员工全生命周期管理", successMetric: "HR事务处理效率提升 60%" },
      { title: "系统管理", category: "系统管理", objective: "灵活的系统配置与管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "财务管理": ["总账管理", "应收管理", "应付管理", "资产管理", "资金管理", "财务报表", "预算管理", "费用报销"],
      "采购管理": ["供应商管理", "采购询价", "采购订单", "采购入库", "采购退货", "采购结算", "采购分析"],
      "库存管理": ["库存盘点", "库存调拨", "库存预警", "批次管理", "序列号管理", "多仓库管理", "库存报表"],
      "销售管理": ["客户管理", "报价管理", "销售订单", "发货管理", "销售退货", "销售结算", "销售分析"],
      "生产管理": ["BOM管理", "工艺路线", "生产计划", "工单管理", "生产领料", "生产入库", "委外加工", "生产报表"],
      "成本管理": ["标准成本", "实际成本", "成本核算", "成本分析", "成本控制", "利润分析"],
      "固定资产管理": ["资产登记", "折旧计算", "资产盘点", "资产调拨", "资产处置", "资产报表"],
      "供应链管理": ["需求预测", "MRP运算", "采购计划", "配送管理", "供应商协同"],
      "人力资源管理": ["组织架构", "员工档案", "招聘管理", "考勤管理", "薪酬管理", "绩效管理", "培训管理"],
      "系统管理": ["用户管理", "角色权限", "审批流程", "系统参数", "操作日志", "数据备份"],
    },
    coreKPIs: [
      "库存周转率", "订单交付率", "采购成本节约率",
      "生产计划达成率", "月结天数", "资产利用率",
      "应收账款周转天数", "应付账款周转天数", "毛利率",
    ],
    coreRoles: [
      "系统管理员", "财务总监", "会计", "出纳",
      "采购经理", "采购员", "仓库管理员",
      "销售经理", "销售员", "生产计划员", "车间主任",
      "成本会计", "HR经理", "CEO/总经理",
    ],
    terminology: [
      { term: "BOM", meaning: "物料清单 (Bill of Materials)" },
      { term: "MRP", meaning: "物料需求计划 (Material Requirements Planning)" },
      { term: "SKU", meaning: "库存量单位 (Stock Keeping Unit)" },
      { term: "COGS", meaning: "销售成本 (Cost of Goods Sold)" },
      { term: "WIP", meaning: "在制品 (Work in Progress)" },
      { term: "MTS/MTO", meaning: "按库存/按订单生产 (Make to Stock/Order)" },
      { term: "3-way match", meaning: "采购订单-收货单-发票三方匹配" },
    ],
    constraints: [
      "财务数据必须满足会计准则（CAS/IFRS）",
      "库存出入库需留痕，不可直接修改库存数量",
      "采购订单与收货单需三方匹配",
      "成本核算需支持多成本中心分摊",
      "系统需支持多组织、多币种、多会计准则",
    ],
    regulations: [
      "企业会计准则 (CAS)", "国际财务报告准则 (IFRS)",
      "增值税法规", "企业所得税法",
      "数据安全法", "个人信息保护法",
      "SOX合规 (如上市)", "金税四期对接要求",
    ],
  }),

  // ──────────────────────────────────────
  // 2. MES — Manufacturing Execution System
  // ──────────────────────────────────────
  MES: Object.freeze({
    name: "MES",
    displayName: "制造执行系统",
    description: "连接ERP与车间现场，实现生产过程实时管控、质量追溯与绩效分析",
    category: DOMAIN_CATEGORY.INDUSTRIAL,
    keywords: ["MES", "制造执行", "生产执行", "车间管理", "工业制造", "智造", "数字工厂", "智能制造"],
    aliases: ["MES系统", "工业MES", "制造执行系统"],
    coreProcesses: [
      "工单下发与执行",
      "物料投料与追溯",
      "生产过程数据采集",
      "质量检验与判定",
      "设备状态监控与OEE",
      "产品追溯（正反向）",
      "生产报工与绩效",
    ],
    coreEntities: [
      "工单", "工艺路线", "工序", "工位",
      "物料批号", "序列号", "产品BOM",
      "质检标准", "检验记录", "不合格品",
      "设备台账", "设备状态", "OEE数据",
      "报工记录", "工时", "产量", "不良品",
      "追溯链", "工装模具", "SOP",
    ],
    coreEpics: [
      { title: "生产执行", category: "生产执行", objective: "工单全生命周期管控", successMetric: "工单准时完工率 ≥ 95%" },
      { title: "工单管理", category: "工单管理", objective: "工单排程与派工", successMetric: "排程效率提升 40%" },
      { title: "设备管理", category: "设备管理", objective: "设备全生命周期与OEE", successMetric: "OEE ≥ 85%" },
      { title: "质量管理", category: "质量管理", objective: "全过程质量管控", successMetric: "一次合格率 ≥ 98%" },
      { title: "追溯管理", category: "追溯管理", objective: "正反向全链路追溯", successMetric: "追溯时间 < 5分钟" },
      { title: "报工管理", category: "报工管理", objective: "实时工时与产量采集", successMetric: "报工准确率 ≥ 99%" },
      { title: "车间看板", category: "车间看板", objective: "实时生产过程可视化", successMetric: "异常响应时间 < 15分钟" },
      { title: "生产计划", category: "生产计划", objective: "精细化排产与调度", successMetric: "计划达成率 ≥ 95%" },
      { title: "OEE分析", category: "OEE分析", objective: "设备综合效率分析优化", successMetric: "OEE提升 15%" },
      { title: "系统管理", category: "系统管理", objective: "基础配置与集成管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "生产执行": ["工单接收", "工序流转", "生产领料", "完工入库", "异常处理", "生产进度"],
      "工单管理": ["工单排程", "工单派工", "工单拆分", "工单合并", "急单插单", "工单报表"],
      "设备管理": ["设备台账", "设备点检", "维修管理", "备件管理", "设备联网", "OEE采集"],
      "质量管理": ["质检标准", "来料检验", "过程检验", "完工检验", "不合格品处理", "SPC分析"],
      "追溯管理": ["批次追溯", "序列号追溯", "物料追溯", "过程追溯", "人员追溯", "追溯报告"],
      "报工管理": ["工时采集", "产量报工", "不良品记录", "报工审核", "计件工资", "绩效报表"],
      "车间看板": ["生产进度看板", "质量看板", "设备看板", "安灯看板", "人员看板", "KPI看板"],
      "生产计划": ["主生产计划", "物料需求计划", "产能计划", "外协计划", "插单管理", "排程仿真"],
      "OEE分析": ["设备OEE", "时间开动率", "性能开动率", "合格品率", "OEE趋势", "损失分析"],
      "系统管理": ["工厂建模", "工艺建模", "用户权限", "审批流程", "数据接口", "操作日志"],
    },
    coreKPIs: [
      "OEE (设备综合效率)", "工单准时完工率", "一次合格率 (FPY)",
      "生产周期 (Manufacturing Cycle Time)", "设备停机率",
      "换型时间 (SMED)", "在制品库存 (WIP)", "计划达成率",
      "直通率 (RTY)", "质量损失成本 (COPQ)",
    ],
    coreRoles: [
      "系统管理员", "工厂厂长", "生产经理", "车间主任",
      "班组长", "操作工", "设备工程师", "质量工程师",
      "工艺工程师", "计划员", "物料员", "维修技师",
    ],
    terminology: [
      { term: "OEE", meaning: "设备综合效率 (Overall Equipment Effectiveness) = 时间开动率 × 性能开动率 × 合格品率" },
      { term: "FPY", meaning: "一次合格率 (First Pass Yield)" },
      { term: "SMED", meaning: "快速换型 (Single Minute Exchange of Die)" },
      { term: "Andon", meaning: "安灯系统 — 车间异常呼叫与可视化" },
      { term: "SPC", meaning: "统计过程控制 (Statistical Process Control)" },
      { term: "MCT", meaning: "制造周期时间 (Manufacturing Cycle Time)" },
      { term: "RTY", meaning: "直通率 (Rolled Throughput Yield)" },
      { term: "COPQ", meaning: "不良质量成本 (Cost of Poor Quality)" },
    ],
    constraints: [
      "工单状态变更需留痕，不可跳转非法状态",
      "质量判定需记录判定人+判定时间+判定依据",
      "追溯需支持正向（批次→产品）和反向（产品→批次）",
      "设备数据采集延迟需 ≤ 1s（实时性要求）",
      "车间网络可能不稳定，需支持离线模式",
    ],
    regulations: [
      "ISO 9001 质量管理体系", "IATF 16949 汽车行业质量",
      "GMP 药品生产质量管理规范", "FDA 21 CFR Part 11 电子记录",
      "安全生产法", "环境保护法",
      "工业互联网安全标准", "智能制造能力成熟度模型",
    ],
  }),

  // ──────────────────────────────────────
  // 3. CRM — Customer Relationship Management
  // ──────────────────────────────────────
  CRM: Object.freeze({
    name: "CRM",
    displayName: "客户关系管理",
    description: "管理客户全生命周期，从线索到回款，实现销售过程数字化与客户价值最大化",
    category: DOMAIN_CATEGORY.ENTERPRISE_SOFTWARE,
    keywords: ["CRM", "客户管理", "销售管理", "客户关系", "销售漏斗", "商机", "营销", "客服"],
    aliases: ["CRM系统", "客户关系管理系统"],
    coreProcesses: [
      "线索到商机 (Lead-to-Opportunity)",
      "商机到合同 (Opportunity-to-Contract)",
      "合同到回款 (Contract-to-Cash)",
      "客户服务与支持",
      "客户分析与画像",
      "营销活动管理",
    ],
    coreEntities: [
      "客户", "联系人", "线索", "商机",
      "销售漏斗阶段", "报价单", "合同", "回款记录",
      "服务工单", "客户反馈", "客户画像",
      "营销活动", "营销线索", "客户分组",
    ],
    coreEpics: [
      { title: "客户管理", category: "客户管理", objective: "客户360°视图", successMetric: "客户数据完整率 ≥ 95%" },
      { title: "商机管理", category: "商机管理", objective: "商机全生命周期跟踪", successMetric: "商机转化率提升 25%" },
      { title: "销售漏斗", category: "销售管理", objective: "销售过程可视化与预测", successMetric: "销售预测准确率 ≥ 85%" },
      { title: "合同管理", category: "合同管理", objective: "合同全流程数字化", successMetric: "合同审批周期缩短 60%" },
      { title: "报价管理", category: "报价管理", objective: "快速精准报价", successMetric: "报价响应时间 < 2小时" },
      { title: "回款管理", category: "回款管理", objective: "回款计划与催收", successMetric: "回款周期缩短 30%" },
      { title: "客户画像", category: "数据分析", objective: "客户价值分析与分层", successMetric: "客户流失预警准确率 ≥ 80%" },
      { title: "营销管理", category: "营销管理", objective: "精准营销自动化", successMetric: "营销ROI提升 50%" },
      { title: "系统管理", category: "系统管理", objective: "灵活系统配置", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "客户管理": ["客户档案", "联系人管理", "客户分组", "客户标签", "跟进记录", "客户分析", "客户合并"],
      "商机管理": ["商机创建", "阶段推进", "商机预测", "竞争对手", "丢单分析", "商机转移"],
      "销售漏斗": ["漏斗视图", "阶段管理", "销售预测", "漏斗分析", "转化率分析"],
      "合同管理": ["合同创建", "合同审批", "合同变更", "合同归档", "到期提醒"],
      "报价管理": ["报价生成", "价格审批", "报价模板", "报价跟踪", "报价分析"],
      "回款管理": ["回款计划", "回款登记", "发票管理", "催收管理", "账龄分析"],
      "客户画像": ["客户标签", "价值评分", "流失预警", "购买偏好", "RFM分析"],
      "营销管理": ["营销活动", "营销邮件", "线索培育", "营销分析", "ROI分析"],
      "系统管理": ["用户权限", "审批流程", "字段配置", "报表配置", "集成设置"],
    },
    coreKPIs: [
      "商机转化率", "销售周期长度", "客户获取成本 (CAC)",
      "客户生命周期价值 (LTV)", "客户流失率", "回款周期 (DSO)",
      "赢单率", "客单价", "营销ROI",
    ],
    coreRoles: [
      "系统管理员", "销售总监", "销售经理", "销售代表",
      "售前工程师", "客户成功经理", "市场经理", "财务",
    ],
    terminology: [
      { term: "LTV", meaning: "客户生命周期价值 (Lifetime Value)" },
      { term: "CAC", meaning: "客户获取成本 (Customer Acquisition Cost)" },
      { term: "DSO", meaning: "应收账款周转天数 (Days Sales Outstanding)" },
      { term: "RFM", meaning: "最近购买/频率/金额分析 (Recency/Frequency/Monetary)" },
      { term: "Pipeline", meaning: "销售管道/漏斗" },
      { term: "Churn", meaning: "客户流失" },
    ],
    constraints: [
      "客户数据归属需支持公海/私海机制",
      "合同金额与回款金额需自动校验",
      "商机阶段推进需记录变更历史",
      "敏感客户信息需脱敏处理",
    ],
    regulations: [
      "个人信息保护法", "数据安全法",
      "GDPR (涉及欧洲客户)", "CCPA (涉及美国客户)",
      "电子签名法 (电子合同)",
    ],
  }),

  // ──────────────────────────────────────
  // 4. WMS — Warehouse Management System
  // ──────────────────────────────────────
  WMS: Object.freeze({
    name: "WMS",
    displayName: "仓库管理系统",
    description: "精细化仓库作业管理，涵盖入库、出库、库内作业、库存盘点与优化",
    category: DOMAIN_CATEGORY.ENTERPRISE_SOFTWARE,
    keywords: ["WMS", "仓库管理", "仓储", "物流", "拣货", "出入库", "库位", "波次"],
    aliases: ["WMS系统", "仓储管理系统"],
    coreProcesses: [
      "收货入库流程", "上架策略执行",
      "拣货出库流程", "波次管理",
      "库内补货与移库", "库存盘点",
      "退货入库流程", "增值加工",
    ],
    coreEntities: [
      "仓库", "库区", "库位", "货架",
      "托盘", "周转箱", "物料/商品",
      "入库单", "出库单", "移库单", "盘点单",
      "波次任务", "拣货任务", "上架任务",
      "库存批次", "库存流水", "库存台账",
    ],
    coreEpics: [
      { title: "入库管理", category: "入库管理", objective: "收货入库全流程自动化", successMetric: "入库效率提升 50%" },
      { title: "出库管理", category: "出库管理", objective: "高效拣货与出库", successMetric: "拣货准确率 ≥ 99.9%" },
      { title: "库内管理", category: "库内管理", objective: "库内作业精细化管理", successMetric: "库位利用率 ≥ 90%" },
      { title: "盘点管理", category: "盘点管理", objective: "灵活高效的库存盘点", successMetric: "盘点差异率 < 0.1%" },
      { title: "波次管理", category: "波次管理", objective: "智能波次合并与优化", successMetric: "拣货路径缩短 30%" },
      { title: "策略管理", category: "策略管理", objective: "可配置的仓库策略引擎", successMetric: "策略配置覆盖率 100%" },
      { title: "系统管理", category: "系统管理", objective: "系统配置与集成", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "入库管理": ["ASN收货", "质检入库", "上架推荐", "越库收货", "退货入库", "入库报表"],
      "出库管理": ["订单波次", "拣货任务", "复核打包", "发货交接", "出库报表"],
      "库内管理": ["库存查询", "库存移动", "库存补货", "库存锁定", "库存调整", "效期管理"],
      "盘点管理": ["明盘", "盲盘", "循环盘点", "动碰盘点", "盘点差异", "盘点报告"],
      "波次管理": ["波次规则", "波次生成", "波次下发", "波次监控"],
      "策略管理": ["上架策略", "分配策略", "补货策略", "波次策略", "周转策略"],
      "系统管理": ["仓库建模", "用户权限", "设备管理", "接口管理", "操作日志"],
    },
    coreKPIs: [
      "拣货准确率", "入库效率 (行/小时)", "出库效率 (行/小时)",
      "库位利用率", "库存准确率", "盘点差异率",
      "订单准时发货率", "库内周转天数",
    ],
    coreRoles: [
      "系统管理员", "仓库经理", "仓库主管",
      "收货员", "拣货员", "复核员", "叉车工",
      "盘点员", "退货处理员",
    ],
    terminology: [
      { term: "ASN", meaning: "预发货通知 (Advanced Shipping Notice)" },
      { term: "WMS", meaning: "仓库管理系统" },
      { term: "FIFO/FEFO", meaning: "先进先出/先到期先出 (First In/Expired First Out)" },
      { term: "Cross-docking", meaning: "越库配送 — 收货后直接转运不存储" },
      { term: "Wave", meaning: "波次 — 将多个订单合并为一批拣货任务" },
      { term: "Putaway", meaning: "上架 — 将收货商品放入库位" },
    ],
    constraints: [
      "RF/RFID设备支持（扫码、RFID读取）",
      "批次/序列号/效期严格管理",
      "库位容量实时校验",
      "FIFO/FEFO规则强制执行",
      "高并发拣货任务需实时同步",
    ],
    regulations: [
      "GSP 药品经营质量管理规范 (医药仓库)",
      "食品仓储卫生规范 (食品仓库)",
      "危险品仓储管理规定 (化工仓库)",
      "安全生产法",
    ],
  }),

  // ──────────────────────────────────────
  // 5. SCM — Supply Chain Management
  // ──────────────────────────────────────
  SCM: Object.freeze({
    name: "SCM",
    displayName: "供应链管理",
    description: "端到端供应链协同平台，涵盖需求预测、采购计划、供应商管理、物流配送",
    category: DOMAIN_CATEGORY.ENTERPRISE_SOFTWARE,
    keywords: ["SCM", "供应链", "物流", "配送", "供应商", "需求预测", "采购计划"],
    aliases: ["SCM系统", "供应链管理系统"],
    coreProcesses: [
      "需求预测与计划",
      "采购寻源与供应商管理",
      "订单协同与跟踪",
      "物流配送执行",
      "仓储与库存协同",
      "供应链风险管理",
    ],
    coreEntities: [
      "供应商", "采购订单", "交货计划", "物流订单",
      "配送路线", "运输车辆", "仓库网络", "库存",
      "需求预测", "供应计划", "供应商评估",
    ],
    coreEpics: [
      { title: "供应商管理", category: "供应商管理", objective: "供应商全生命周期管理", successMetric: "供应商准时交付率 ≥ 95%" },
      { title: "需求预测", category: "需求预测", objective: "AI驱动需求预测", successMetric: "预测准确率 ≥ 85%" },
      { title: "采购协同", category: "采购协同", objective: "供应商在线协同", successMetric: "采购订单确认时间 < 2小时" },
      { title: "物流管理", category: "物流管理", objective: "运输与配送优化", successMetric: "配送准时率 ≥ 98%" },
      { title: "库存协同", category: "库存协同", objective: "多级库存优化", successMetric: "库存周转率提升 30%" },
      { title: "供应链风险", category: "风险管理", objective: "供应链风险预警", successMetric: "风险预警提前 ≥ 7天" },
      { title: "系统管理", category: "系统管理", objective: "平台配置管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "供应商管理": ["供应商准入", "供应商评估", "供应商分级", "供应商绩效", "供应商退出"],
      "需求预测": ["历史数据分析", "季节因子", "促销影响", "预测调整", "预测精度分析"],
      "采购协同": ["采购订单协同", "交货计划协同", "质量协同", "结算协同", "VMI管理"],
      "物流管理": ["路线规划", "运输调度", "在途跟踪", "签收管理", "运费结算"],
      "库存协同": ["多级库存", "安全库存", "库存共享", "库存调拨", "呆滞预警"],
      "供应链风险": ["风险识别", "风险评级", "预警规则", "应急方案", "风险看板"],
      "系统管理": ["组织架构", "用户权限", "主数据", "接口管理", "操作日志"],
    },
    coreKPIs: [
      "供应商准时交付率 (OTD)", "需求预测准确率",
      "库存周转天数", "配送准时率", "供应链总成本",
      "完美订单率", "现金转换周期 (CCC)",
    ],
    coreRoles: [
      "系统管理员", "供应链总监", "采购经理", "计划经理",
      "物流经理", "供应商质量工程师", "仓配经理",
    ],
    terminology: [
      { term: "OTD", meaning: "准时交付率 (On-Time Delivery)" },
      { term: "VMI", meaning: "供应商管理库存 (Vendor Managed Inventory)" },
      { term: "CCC", meaning: "现金转换周期 (Cash Conversion Cycle)" },
      { term: "Bullwhip", meaning: "牛鞭效应 — 需求波动沿供应链放大" },
      { term: "S&OP", meaning: "销售与运营规划 (Sales & Operations Planning)" },
    ],
    constraints: [
      "多级供应商数据需加密隔离",
      "预测模型需定期回溯验证",
      "物流轨迹需实时同步",
    ],
    regulations: [
      "合同法", "招标投标法",
      "进出口贸易法规", "海关监管规定",
    ],
  }),

  // ──────────────────────────────────────
  // 6. HRM — Human Resource Management
  // ──────────────────────────────────────
  HRM: Object.freeze({
    name: "HRM",
    displayName: "人力资源管理",
    description: "覆盖员工全生命周期（招聘、入职、考勤、薪酬、绩效、培训、离职）的一体化人才管理平台",
    category: DOMAIN_CATEGORY.MANAGEMENT,
    keywords: ["HRM", "HR", "人事", "考勤", "薪酬", "招聘", "绩效", "人力资源", "eHR"],
    aliases: ["HRM系统", "人力资源管理系统", "eHR系统"],
    coreProcesses: [
      "招聘到入职 (Recruit-to-Hire)",
      "考勤到薪酬 (Time-to-Pay)",
      "绩效管理循环 (Plan-Perform-Review)",
      "培训与发展 (Learn-to-Grow)",
      "员工服务与自助",
    ],
    coreEntities: [
      "员工", "部门", "岗位", "职级",
      "劳动合同", "考勤记录", "请假单", "加班单",
      "薪酬方案", "工资条", "社保公积金",
      "绩效考核", "培训课程", "招聘需求", "简历",
    ],
    coreEpics: [
      { title: "组织人事", category: "组织人事", objective: "组织架构与人员管理", successMetric: "人事数据完整率 ≥ 99%" },
      { title: "招聘管理", category: "招聘管理", objective: "全流程招聘管理", successMetric: "招聘周期缩短 30%" },
      { title: "考勤管理", category: "考勤管理", objective: "灵活考勤规则引擎", successMetric: "考勤准确率 ≥ 99.9%" },
      { title: "薪酬管理", category: "薪酬管理", objective: "精准薪酬核算", successMetric: "薪酬核算准确率 100%" },
      { title: "绩效管理", category: "绩效管理", objective: "目标管理与评估", successMetric: "绩效流程完成率 ≥ 95%" },
      { title: "培训管理", category: "培训管理", objective: "员工学习与发展", successMetric: "培训完成率 ≥ 90%" },
      { title: "员工自助", category: "员工自助", objective: "员工自助服务平台", successMetric: "自助服务占比 ≥ 80%" },
      { title: "系统管理", category: "系统管理", objective: "系统配置管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "组织人事": ["组织架构", "岗位管理", "员工档案", "入离职管理", "合同管理", "人事异动", "人员报表"],
      "招聘管理": ["需求管理", "简历筛选", "面试安排", "offer管理", "入职办理", "招聘分析"],
      "考勤管理": ["排班管理", "打卡管理", "请假管理", "加班管理", "出差管理", "考勤报表"],
      "薪酬管理": ["薪酬方案", "薪资计算", "个税计算", "社保公积金", "工资条", "薪酬分析"],
      "绩效管理": ["目标设定", "绩效评估", "360评估", "绩效反馈", "绩效校准", "绩效报表"],
      "培训管理": ["课程管理", "培训计划", "在线学习", "考试管理", "培训档案", "培训分析"],
      "员工自助": ["个人信息", "请假申请", "工资查询", "证明开具", "福利选择", "内部招聘"],
      "系统管理": ["用户权限", "审批流程", "规则引擎", "报表配置", "接口管理", "操作日志"],
    },
    coreKPIs: [
      "招聘周期", "员工流失率", "人均培训时长",
      "薪酬核算准确率", "考勤异常率", "人效比",
    ],
    coreRoles: [
      "系统管理员", "HR总监", "HRBP", "招聘专员",
      "薪酬专员", "培训专员", "部门经理", "员工",
    ],
    terminology: [
      { term: "HRBP", meaning: "人力资源业务伙伴 (HR Business Partner)" },
      { term: "OKR", meaning: "目标与关键成果 (Objectives and Key Results)" },
      { term: "KPI", meaning: "关键绩效指标 (Key Performance Indicator)" },
      { term: "ATS", meaning: "招聘管理系统 (Applicant Tracking System)" },
      { term: "TCO", meaning: "总薪酬 (Total Compensation)" },
    ],
    constraints: [
      "薪酬数据严格加密，访问需审计",
      "个税计算需符合最新税法",
      "劳动合同电子签需合规",
      "员工隐私数据按GDPR/个人信息保护法管理",
    ],
    regulations: [
      "劳动合同法", "社会保险法",
      "个人所得税法", "个人信息保护法",
      "女职工劳动保护特别规定",
      "企业职工带薪年休假条例",
    ],
  }),

  // ──────────────────────────────────────
  // 7. PLM — Product Lifecycle Management
  // ──────────────────────────────────────
  PLM: Object.freeze({
    name: "PLM",
    displayName: "产品生命周期管理",
    description: "管理产品从概念、设计、制造到退市的全生命周期，涵盖BOM、CAD集成、变更管理与合规",
    category: DOMAIN_CATEGORY.ENGINEERING,
    keywords: ["PLM", "产品生命周期", "BOM", "变更管理", "PDM", "产品数据", "研发管理", "CAD"],
    aliases: ["PLM系统", "产品生命周期管理系统", "PDM系统"],
    coreProcesses: [
      "产品规划与定义",
      "设计协同 (CAD集成)",
      "BOM管理与配置",
      "工程变更管理 (ECN/ECO)",
      "合规与认证管理",
      "产品退市管理",
    ],
    coreEntities: [
      "产品", "零部件", "BOM (EBOM/MBOM)",
      "设计文档", "CAD模型", "技术规格",
      "变更请求 (ECR)", "变更通知 (ECN)", "变更单 (ECO)",
      "供应商零部件", "合规证书", "产品配置",
    ],
    coreEpics: [
      { title: "产品数据管理", category: "产品数据", objective: "集中化产品数据管理", successMetric: "数据查找时间缩短 80%" },
      { title: "BOM管理", category: "BOM管理", objective: "多视图BOM管理", successMetric: "BOM准确率 ≥ 99.5%" },
      { title: "变更管理", category: "变更管理", objective: "工程变更全流程管控", successMetric: "变更处理周期缩短 50%" },
      { title: "设计协同", category: "设计协同", objective: "多CAD集成协同", successMetric: "设计协同效率提升 40%" },
      { title: "合规管理", category: "合规管理", objective: "法规合规自动化", successMetric: "合规审查时间缩短 60%" },
      { title: "供应商协同", category: "供应商协同", objective: "供应商零部件协同", successMetric: "供应商响应时间缩短 40%" },
      { title: "系统管理", category: "系统管理", objective: "系统配置管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "产品数据管理": ["产品结构", "文档管理", "版本管理", "分类管理", "搜索检索", "数据看板"],
      "BOM管理": ["EBOM管理", "MBOM管理", "BOM比较", "BOM展开", "物料替代", "BOM版本"],
      "变更管理": ["变更请求", "变更评审", "变更执行", "变更通知", "变更历史", "变更影响分析"],
      "设计协同": ["CAD集成", "设计检入检出", "可视化浏览", "标注审批", "设计对比"],
      "合规管理": ["法规库", "合规检查", "认证管理", "物质合规 (REACH/RoHS)", "合规报告"],
      "供应商协同": ["供应商目录", "询报价", "样品管理", "PPAP", "供应商审核"],
      "系统管理": ["权限管理", "流程引擎", "编码规则", "集成接口", "操作审计"],
    },
    coreKPIs: [
      "BOM准确率", "变更处理周期", "设计重用率",
      "产品上市周期", "合规审查通过率", "数据完整率",
    ],
    coreRoles: [
      "系统管理员", "研发总监", "设计工程师", "工艺工程师",
      "质量工程师", "采购工程师", "合规专员", "配置管理员",
    ],
    terminology: [
      { term: "EBOM/MBOM", meaning: "工程BOM/制造BOM (Engineering/Manufacturing BOM)" },
      { term: "ECR/ECN/ECO", meaning: "工程变更请求/通知/单" },
      { term: "PPAP", meaning: "生产件批准程序 (Production Part Approval Process)" },
      { term: "REACH", meaning: "欧盟化学品法规 (Registration, Evaluation, Authorisation of Chemicals)" },
      { term: "RoHS", meaning: "有害物质限制指令 (Restriction of Hazardous Substances)" },
    ],
    constraints: [
      "BOM变更需审批流程，不可直接修改",
      "CAD文件大，需支持增量同步",
      "版本管理需保留完整历史",
      "合规数据需定期更新",
    ],
    regulations: [
      "ISO 9001", "IATF 16949",
      "REACH 法规", "RoHS 指令",
      "FDA 510(k) (医疗设备)", "产品认证相关法规",
    ],
  }),

  // ──────────────────────────────────────
  // 8. CAD — Computer-Aided Design Platform
  // ──────────────────────────────────────
  CAD: Object.freeze({
    name: "CAD",
    displayName: "CAD设计平台",
    description: "云端CAD设计协作平台，支持2D/3D建模、仿真分析、设计评审与版本管理",
    category: DOMAIN_CATEGORY.ENGINEERING,
    keywords: ["CAD", "设计", "建模", "3D", "仿真", "CAM", "CAE", "图纸", "BIM"],
    aliases: ["CAD系统", "CAD平台", "云CAD"],
    coreProcesses: [
      "2D/3D建模",
      "参数化设计",
      "装配设计",
      "仿真分析 (CAE)",
      "设计评审与标注",
      "图纸生成与导出",
    ],
    coreEntities: [
      "项目", "设计文件", "零部件", "装配体",
      "图纸", "标注", "材料", "仿真结果",
      "版本", "分支", "设计模板",
    ],
    coreEpics: [
      { title: "建模引擎", category: "核心引擎", objective: "高性能2D/3D建模", successMetric: "建模响应时间 < 100ms" },
      { title: "装配设计", category: "装配设计", objective: "复杂装配体管理", successMetric: "支持 10,000+ 零部件装配" },
      { title: "参数化设计", category: "参数化", objective: "参数驱动设计变更", successMetric: "参数变更传播时间 < 1s" },
      { title: "仿真分析", category: "仿真", objective: "集成CAE仿真", successMetric: "仿真结果精度 ≥ 95%" },
      { title: "协同评审", category: "协同", objective: "实时协同设计评审", successMetric: "多人协同延迟 < 200ms" },
      { title: "图纸管理", category: "图纸管理", objective: "自动图纸生成", successMetric: "图纸生成准确率 ≥ 99%" },
      { title: "版本管理", category: "版本管理", objective: "分支与版本管理", successMetric: "版本回滚时间 < 5s" },
      { title: "系统管理", category: "系统管理", objective: "平台管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "建模引擎": ["草图绘制", "实体建模", "曲面建模", "特征操作", "布尔运算", "测量工具"],
      "装配设计": ["部件装配", "约束管理", "干涉检查", "装配爆炸图", "BOM提取"],
      "参数化设计": ["参数定义", "公式驱动", "配置管理", "设计表", "族表管理"],
      "仿真分析": ["应力分析", "热分析", "模态分析", "流体仿真", "拓扑优化", "仿真报告"],
      "协同评审": ["实时协同", "标注评论", "版本对比", "审批流程", "设计评审"],
      "图纸管理": ["视图生成", "尺寸标注", "公差标注", "BOM表", "图纸导出"],
      "版本管理": ["版本创建", "分支管理", "合并", "差异对比", "回滚"],
      "系统管理": ["用户权限", "项目空间", "模板管理", "标准件库", "操作审计"],
    },
    coreKPIs: [
      "建模响应时间", "大装配加载时间", "仿真求解时间",
      "设计重用率", "设计变更传播时间", "协同并发数",
    ],
    coreRoles: [
      "系统管理员", "设计主管", "机械工程师", "结构工程师",
      "仿真工程师", "工艺工程师", "审图员",
    ],
    terminology: [
      { term: "NURBS", meaning: "非均匀有理B样条 (曲面建模)" },
      { term: "FEA", meaning: "有限元分析 (Finite Element Analysis)" },
      { term: "B-Rep", meaning: "边界表示法 (Boundary Representation)" },
      { term: "CSG", meaning: "构造实体几何 (Constructive Solid Geometry)" },
      { term: "STEP/IGES", meaning: "标准数据交换格式" },
    ],
    constraints: [
      "大装配体（10K+零部件）实时渲染性能",
      "参数化求解器需支持循环依赖检测",
      "文件格式兼容性（step/iges/stl/dwg）",
      "GPU加速渲染要求",
    ],
    regulations: [
      "ISO 10303 (STEP标准)", "ISO 16792 (数字化产品定义)",
      "ASME Y14 (工程图纸标准)", "知识产权保护法",
    ],
  }),

  // ──────────────────────────────────────
  // 9. EDA — Electronic Design Automation
  // ──────────────────────────────────────
  EDA: Object.freeze({
    name: "EDA",
    displayName: "电子设计自动化",
    description: "芯片与电路板设计全流程平台，涵盖原理图、PCB布局、信号仿真与DFM检查",
    category: DOMAIN_CATEGORY.ENGINEERING,
    keywords: ["EDA", "电路设计", "PCB", "原理图", "芯片", "Layout", "仿真", "IC"],
    aliases: ["EDA系统", "EDA平台", "电子设计自动化"],
    coreProcesses: [
      "原理图设计",
      "PCB布局布线",
      "信号完整性仿真",
      "电源完整性分析",
      "DFM/DFT检查",
      "元器件库管理",
    ],
    coreEntities: [
      "元器件", "符号", "封装", "原理图",
      "PCB", "网络表", "层叠结构", "设计规则",
      "仿真模型", "DFM报告", "Gerber文件",
    ],
    coreEpics: [
      { title: "原理图设计", category: "设计", objective: "高效原理图编辑", successMetric: "原理图编辑响应 < 50ms" },
      { title: "PCB布局", category: "设计", objective: "高性能PCB Layout", successMetric: "支持 32 层以上PCB" },
      { title: "元器件库", category: "数据", objective: "统一元器件库管理", successMetric: "元器件库覆盖率 ≥ 95%" },
      { title: "信号仿真", category: "仿真", objective: "高速信号完整性分析", successMetric: "仿真精度 ≥ 98%" },
      { title: "电源分析", category: "仿真", objective: "PDN电源完整性", successMetric: "PI分析覆盖率 100%" },
      { title: "DFM检查", category: "制造", objective: "可制造性自动检查", successMetric: "DFM通过率一次 ≥ 90%" },
      { title: "设计规则", category: "规则", objective: "规则驱动设计", successMetric: "DRC检查覆盖率 100%" },
      { title: "系统管理", category: "管理", objective: "平台管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "原理图设计": ["符号放置", "连线编辑", "层次化设计", "ERC检查", "网表生成", "BOM导出"],
      "PCB布局": ["布局编辑", "布线编辑", "差分对", "等长匹配", "阻抗控制", "铺铜"],
      "元器件库": ["符号创建", "封装创建", "库检索", "版本管理", "供应商集成"],
      "信号仿真": ["SI分析", "串扰分析", "时序分析", "眼图", "S参数提取"],
      "电源分析": ["PDN分析", "IR Drop", "去耦电容优化", "PDN阻抗"],
      "DFM检查": ["DFM规则", "DFM报告", "DRC", "装配检查"],
      "设计规则": ["规则编辑", "规则分类", "规则优先级", "在线DRC", "批量DRC"],
      "系统管理": ["项目空间", "用户权限", "模板管理", "接口管理", "操作审计"],
    },
    coreKPIs: [
      "DRC通过率", "仿真准确性", "PCB首版成功率",
      "设计周期", "元器件库覆盖率", "Gerber文件准确率",
    ],
    coreRoles: [
      "系统管理员", "硬件总监", "原理图工程师", "PCB Layout工程师",
      "SI/PI工程师", "元器件工程师", "DFM工程师",
    ],
    terminology: [
      { term: "SI/PI", meaning: "信号完整性/电源完整性" },
      { term: "DRC", meaning: "设计规则检查 (Design Rule Check)" },
      { term: "DFM", meaning: "可制造性设计 (Design for Manufacturing)" },
      { term: "Gerber", meaning: "PCB制造文件格式" },
      { term: "PDN", meaning: "电源分配网络 (Power Distribution Network)" },
      { term: "IBIS/SPICE", meaning: "仿真模型格式" },
    ],
    constraints: [
      "高密度互连 (HDI) 设计支持",
      "高速信号完整性仿真需高频模型",
      "DRC规则需实时检查（不阻塞编辑器）",
      "大型PCB（10K+焊盘）渲染性能",
    ],
    regulations: [
      "IPC-2221 (PCB设计通用标准)", "IPC-7351 (封装标准)",
      "UL认证", "FCC电磁兼容", "RoHS指令",
    ],
  }),

  // ──────────────────────────────────────
  // 10. AI Platform
  // ──────────────────────────────────────
  "AI Platform": Object.freeze({
    name: "AI Platform",
    displayName: "AI平台",
    description: "企业级AI应用平台，涵盖Agent管理、知识库、对话交互、模型管理、数据分析等核心能力",
    category: DOMAIN_CATEGORY.INTELLIGENCE,
    keywords: ["AI", "智能", "Agent", "知识库", "对话", "客服", "NLP", "大模型", "LLM", "RAG", "机器学习"],
    aliases: ["AI平台", "智能客服", "AI Agent", "大模型平台"],
    coreProcesses: [
      "知识摄取与索引",
      "Agent创建与配置",
      "对话交互与路由",
      "模型推理与优化",
      "用户反馈与迭代",
      "数据分析与监控",
    ],
    coreEntities: [
      "知识库", "文档", "知识条目", "向量索引",
      "Agent", "Agent配置", "对话会话", "消息",
      "大模型", "Prompt模板", "推理记录",
      "用户", "角色", "权限", "操作日志",
    ],
    coreEpics: [
      { title: "知识库管理", category: "内容管理", objective: "高质量可检索知识体系", successMetric: "检索准确率 ≥ 95%" },
      { title: "Agent管理", category: "智能/AI", objective: "Agent全生命周期管理", successMetric: "Agent配置时间 < 10分钟" },
      { title: "对话管理", category: "业务流程", objective: "流畅的AI对话体验", successMetric: "首响时间 < 3s" },
      { title: "模型管理", category: "智能/AI", objective: "多模型统一管理与调度", successMetric: "模型切换时间 < 10s" },
      { title: "用户管理", category: "用户管理", objective: "完整用户身份体系", successMetric: "用户数据完整率 ≥ 99%" },
      { title: "运营分析", category: "运营分析", objective: "数据驱动的产品优化", successMetric: "分析报表生成时间 < 30s" },
      { title: "权限管理", category: "安全合规", objective: "细粒度权限控制", successMetric: "权限变更生效时间 < 5s" },
      { title: "系统设置", category: "系统设置", objective: "灵活系统管理能力", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "知识库管理": ["知识库创建", "文档上传", "文档解析", "知识编辑", "索引构建", "版本管理", "知识分类"],
      "Agent管理": ["Agent创建", "Agent配置", "Agent训练", "Agent评测", "Agent发布", "Agent监控"],
      "对话管理": ["对话会话", "消息管理", "意图识别", "对话路由", "多轮对话", "对话记录"],
      "模型管理": ["模型接入", "Prompt管理", "推理配置", "模型评测", "模型监控", "成本管理"],
      "用户管理": ["用户注册", "用户登录", "个人中心", "用户画像", "用户分组"],
      "运营分析": ["数据看板", "对话分析", "用户分析", "知识分析", "模型分析", "业务报表"],
      "权限管理": ["角色管理", "权限分配", "操作审计", "安全策略", "访问控制"],
      "系统设置": ["基本设置", "通知配置", "日志管理", "数据管理", "集成设置"],
    },
    coreKPIs: [
      "知识检索准确率", "首响时间", "对话解决率",
      "用户满意度", "Agent准确率", "月活用户数",
      "模型推理延迟", "知识覆盖率",
    ],
    coreRoles: [
      "超级管理员", "系统管理员", "知识管理员", "Agent管理员",
      "运营经理", "数据分析师", "普通用户", "访客",
    ],
    terminology: [
      { term: "RAG", meaning: "检索增强生成 (Retrieval-Augmented Generation)" },
      { term: "LLM", meaning: "大语言模型 (Large Language Model)" },
      { term: "Embedding", meaning: "向量嵌入 — 文本到高维向量的语义表示" },
      { term: "Prompt", meaning: "提示词 — 引导模型行为的输入模板" },
      { term: "Fine-tuning", meaning: "微调 — 在特定数据上训练基础模型" },
      { term: "Hallucination", meaning: "幻觉 — 模型生成不实信息" },
    ],
    constraints: [
      "模型推理延迟需控制在3秒内",
      "知识库更新后需自动重建索引",
      "Agent回答需可追溯（引用原文）",
      "用户对话数据需脱敏处理",
      "多租户数据隔离",
    ],
    regulations: [
      "个人信息保护法", "数据安全法",
      "深度合成管理规定", "算法推荐管理规定",
      "GDPR (涉及欧洲用户)",
    ],
  }),

  // ──────────────────────────────────────
  // 11. E-Commerce
  // ──────────────────────────────────────
  "E-Commerce": Object.freeze({
    name: "E-Commerce",
    displayName: "电子商务平台",
    description: "多商户/单商户电商平台，涵盖商品管理、交易、支付、物流、营销、售后全链路",
    category: DOMAIN_CATEGORY.COMMERCE,
    keywords: ["电商", "商城", "商品", "订单", "支付", "物流", "营销", "店铺", "B2C", "B2B", "C2C"],
    aliases: ["电商平台", "电商系统", "网上商城", "跨境电商平台"],
    coreProcesses: [
      "商品上架与管理",
      "用户浏览与搜索",
      "购物车与下单",
      "支付与结算",
      "订单履约与物流",
      "售后与评价",
      "营销活动与促销",
    ],
    coreEntities: [
      "商品", "SKU", "类目", "品牌", "规格",
      "店铺", "商家", "用户", "收货地址",
      "购物车", "订单", "支付单", "物流单",
      "优惠券", "促销活动", "评价", "售后单",
    ],
    coreEpics: [
      { title: "商品管理", category: "商品管理", objective: "完整商品生命周期管理", successMetric: "商品发布效率提升 50%" },
      { title: "订单管理", category: "交易管理", objective: "订单全流程透明化", successMetric: "订单处理时间 < 30s" },
      { title: "支付管理", category: "交易管理", objective: "多支付渠道统一接入", successMetric: "支付成功率 ≥ 99.5%" },
      { title: "物流管理", category: "履约管理", objective: "物流全链路追踪", successMetric: "物流信息同步延迟 < 1分钟" },
      { title: "营销管理", category: "营销管理", objective: "灵活营销活动引擎", successMetric: "营销活动上线时间 < 1小时" },
      { title: "用户管理", category: "用户管理", objective: "用户全生命周期", successMetric: "用户注册转化率 ≥ 60%" },
      { title: "售后管理", category: "售后管理", objective: "标准化售后流程", successMetric: "售后处理时效 < 24小时" },
      { title: "商家管理", category: "商家管理", objective: "多商户入驻管理", successMetric: "商家入驻审批 < 2工作日" },
      { title: "数据分析", category: "数据分析", objective: "全链路数据洞察", successMetric: "实时数据延迟 < 5s" },
      { title: "系统管理", category: "系统管理", objective: "平台灵活配置", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "商品管理": ["商品发布", "SKU管理", "类目管理", "品牌管理", "商品审核", "库存管理", "商品采集"],
      "订单管理": ["订单创建", "订单状态", "订单拆分", "订单合并", "订单查询", "订单导出"],
      "支付管理": ["支付渠道", "支付流程", "退款管理", "对账管理", "分账管理"],
      "物流管理": ["物流渠道", "电子面单", "发货管理", "物流追踪", "签收管理"],
      "营销管理": ["优惠券", "满减活动", "秒杀", "拼团", "分销", "积分", "会员体系"],
      "用户管理": ["用户注册", "用户登录", "用户画像", "会员等级", "收货地址"],
      "售后管理": ["退货退款", "换货", "投诉管理", "纠纷仲裁"],
      "商家管理": ["商家入驻", "店铺装修", "商品审核", "结算管理", "商家评级"],
      "数据分析": ["交易分析", "商品分析", "用户分析", "营销分析", "实时大屏"],
      "系统管理": ["权限管理", "审批流程", "消息通知", "操作日志", "数据字典"],
    },
    coreKPIs: [
      "GMV (总交易额)", "转化率", "客单价",
      "复购率", "退货率", "支付成功率",
      "用户获取成本 (CAC)", "用户生命周期价值 (LTV)",
    ],
    coreRoles: [
      "平台管理员", "运营经理", "商家", "客服专员",
      "仓库管理员", "财务", "数据分析师",
    ],
    terminology: [
      { term: "GMV", meaning: "总交易额 (Gross Merchandise Volume)" },
      { term: "SKU", meaning: "库存量单位" },
      { term: "CVR", meaning: "转化率 (Conversion Rate)" },
      { term: "CTR", meaning: "点击率 (Click-Through Rate)" },
      { term: "DAU/MAU", meaning: "日/月活跃用户" },
    ],
    constraints: [
      "高并发下单需保证库存一致性",
      "支付回调需幂等处理",
      "营销规则需支持复杂叠加与互斥",
      "商品搜索需支持毫秒级响应",
    ],
    regulations: [
      "电子商务法", "消费者权益保护法",
      "网络交易管理办法", "个人信息保护法",
      "电子签名法", "跨境电子商务相关规定",
    ],
  }),

  // ──────────────────────────────────────
  // 12. SaaS Platform
  // ──────────────────────────────────────
  SaaS: Object.freeze({
    name: "SaaS",
    displayName: "SaaS平台",
    description: "多租户SaaS通用平台，涵盖租户管理、订阅计费、权限隔离、配置化与集成能力",
    category: DOMAIN_CATEGORY.PLATFORM,
    keywords: ["SaaS", "多租户", "订阅", "计费", "租户", "平台", "SaaS平台"],
    aliases: ["SaaS系统", "SaaS平台", "多租户平台"],
    coreProcesses: [
      "租户注册与开通",
      "订阅计划管理",
      "用量计量与计费",
      "租户配置与定制",
      "权限与数据隔离",
      "集成与开放平台",
    ],
    coreEntities: [
      "租户", "订阅计划", "订阅", "发票",
      "用户", "角色", "权限", "数据源",
      "API Key", "Webhook", "配置项",
      "用量记录", "账单", "支付记录",
    ],
    coreEpics: [
      { title: "租户管理", category: "租户管理", objective: "租户全生命周期管理", successMetric: "租户开通时间 < 5分钟" },
      { title: "订阅计费", category: "订阅计费", objective: "灵活订阅与计费引擎", successMetric: "计费准确率 100%" },
      { title: "权限管理", category: "安全", objective: "多层级权限与数据隔离", successMetric: "权限变更生效 < 5s" },
      { title: "配置管理", category: "配置管理", objective: "租户级灵活配置", successMetric: "配置项覆盖率 ≥ 95%" },
      { title: "开放平台", category: "集成", objective: "API与Webhook生态", successMetric: "API响应时间 < 200ms" },
      { title: "用户管理", category: "用户管理", objective: "统一用户管理", successMetric: "用户数据完整率 ≥ 99%" },
      { title: "运营分析", category: "运营分析", objective: "平台运营数据洞察", successMetric: "实时数据延迟 < 10s" },
      { title: "系统管理", category: "系统管理", objective: "平台管理", successMetric: "系统可配置率 ≥ 95%" },
    ],
    coreFeatures: {
      "租户管理": ["租户注册", "租户审核", "租户配置", "租户监控", "租户停用", "租户分析"],
      "订阅计费": ["计划管理", "定价管理", "订阅管理", "用量计量", "账单生成", "支付集成"],
      "权限管理": ["角色管理", "权限分配", "数据权限", "API权限", "审计日志"],
      "配置管理": ["系统配置", "业务配置", "功能开关", "配置版本", "配置继承"],
      "开放平台": ["API管理", "Webhook", "SDK", "应用市场", "开发者文档"],
      "用户管理": ["用户邀请", "用户管理", "团队管理", "SSO集成"],
      "运营分析": ["租户分析", "收入分析", "用量分析", "流失分析", "运营大屏"],
      "系统管理": ["通知管理", "日志管理", "数据备份", "安全策略", "系统监控"],
    },
    coreKPIs: [
      "MRR (月经常性收入)", "ARR (年经常性收入)",
      "客户流失率 (Churn)", "净收入留存率 (NRR)",
      "客户获取成本 (CAC)", "LTV/CAC比率",
      "租户开通时间", "平台可用性",
    ],
    coreRoles: [
      "平台管理员", "租户管理员", "租户用户",
      "财务", "技术支持", "开发者",
    ],
    terminology: [
      { term: "MRR/ARR", meaning: "月/年经常性收入 (Monthly/Annual Recurring Revenue)" },
      { term: "NRR", meaning: "净收入留存率 (Net Revenue Retention)" },
      { term: "Churn", meaning: "客户流失率" },
      { term: "Tenant", meaning: "租户 — 平台上的独立组织/企业" },
      { term: "Webhook", meaning: "事件回调 — 系统事件的HTTP推送" },
    ],
    constraints: [
      "租户数据严格隔离（数据库/Schema/行级）",
      "计费引擎需支持复杂定价模型",
      "API限流与配额管理",
      "配置变更需审计留痕",
    ],
    regulations: [
      "个人信息保护法", "数据安全法",
      "GDPR", "SOC 2 (安全审计标准)",
      "ISO 27001 (信息安全)",
    ],
  }),

  // ──────────────────────────────────────
  // 13. Project Management
  // ──────────────────────────────────────
  "Project Management": Object.freeze({
    name: "Project Management",
    displayName: "项目管理",
    description: "团队协作与项目管理平台，涵盖任务管理、甘特图、看板、时间追踪、资源管理",
    category: DOMAIN_CATEGORY.MANAGEMENT,
    keywords: ["项目管理", "任务管理", "甘特图", "看板", "协作", "OKR", "工时", "Sprint", "Agile"],
    aliases: ["项目管理系统", "项目管理平台", "PM系统"],
    coreProcesses: [
      "项目创建与规划",
      "任务分解与分配",
      "进度跟踪与更新",
      "资源管理与分配",
      "时间与工时记录",
      "报告与分析",
    ],
    coreEntities: [
      "项目", "任务", "子任务", "里程碑",
      "看板", "列表", "甘特图", "依赖关系",
      "用户", "团队", "工时记录", "文件",
      "Sprint", "Backlog", "发布",
    ],
    coreEpics: [
      { title: "项目管理", category: "项目管理", objective: "项目全生命周期", successMetric: "项目创建时间 < 1分钟" },
      { title: "任务管理", category: "任务管理", objective: "灵活任务体系", successMetric: "任务操作响应 < 100ms" },
      { title: "看板视图", category: "视图", objective: "可视化工作流", successMetric: "看板拖拽响应 < 50ms" },
      { title: "甘特图", category: "视图", objective: "时间线可视化", successMetric: "支持 1000+ 任务渲染" },
      { title: "资源管理", category: "资源管理", objective: "资源负载可视化", successMetric: "资源利用率可视化" },
      { title: "时间追踪", category: "时间追踪", objective: "工时记录与分析", successMetric: "工时记录准确率 ≥ 95%" },
      { title: "报告分析", category: "分析", objective: "多维度项目报告", successMetric: "报告生成时间 < 10s" },
      { title: "系统管理", category: "系统管理", objective: "平台配置", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "项目管理": ["项目创建", "项目模板", "项目归档", "项目搜索", "项目统计"],
      "任务管理": ["任务创建", "任务分配", "子任务", "依赖关系", "优先级", "标签", "附件"],
      "看板视图": ["列管理", "拖拽排序", "WIP限制", "泳道", "卡片自定义"],
      "甘特图": ["时间线视图", "拖拽调整", "依赖连线", "关键路径", "基线对比"],
      "资源管理": ["资源分配", "负载视图", "资源日历", "容量规划"],
      "时间追踪": ["工时记录", "计时器", "工时审批", "工时报表"],
      "报告分析": ["燃尽图", "进度报告", "资源报告", "自定义报表"],
      "系统管理": ["用户权限", "项目模板", "字段配置", "通知设置", "集成管理"],
    },
    coreKPIs: [
      "项目准时完成率", "任务完成率", "工时利用率",
      "Sprint速度 (Velocity)", "缺陷密度", "团队吞吐量",
    ],
    coreRoles: [
      "系统管理员", "项目经理", "产品经理", "开发工程师",
      "设计师", "测试工程师", "Scrum Master",
    ],
    terminology: [
      { term: "WIP", meaning: "进行中工作限制 (Work in Progress Limit)" },
      { term: "Velocity", meaning: "速率 — 每个Sprint完成的故事点数" },
      { term: "Burndown", meaning: "燃尽图 — 剩余工作量趋势" },
      { term: "Sprint", meaning: "迭代周期（通常1-2周）" },
      { term: "Backlog", meaning: "待办事项列表" },
    ],
    constraints: [
      "任务拖拽排序需实时同步（WebSocket）",
      "甘特图大量任务渲染性能",
      "工时记录修改需版本历史",
    ],
    regulations: [],
  }),

  // ──────────────────────────────────────
  // 14. Knowledge Base
  // ──────────────────────────────────────
  "Knowledge Base": Object.freeze({
    name: "Knowledge Base",
    displayName: "知识管理平台",
    description: "企业知识管理平台，涵盖知识创建、组织、搜索、协作与生命周期管理",
    category: DOMAIN_CATEGORY.MANAGEMENT,
    keywords: ["知识库", "知识管理", "wiki", "文档", "知识图谱", "帮助中心", "FAQ"],
    aliases: ["知识管理平台", "知识库系统", "wiki系统"],
    coreProcesses: [
      "知识创建与编辑",
      "知识组织与分类",
      "知识搜索与发现",
      "知识审核与发布",
      "知识版本与更新",
      "知识分析与优化",
    ],
    coreEntities: [
      "知识条目", "分类", "标签", "版本",
      "空间/团队", "用户", "评论", "附件",
      "模板", "搜索索引", "知识图谱",
    ],
    coreEpics: [
      { title: "内容管理", category: "内容管理", objective: "富文本知识编辑", successMetric: "编辑器响应 < 100ms" },
      { title: "知识组织", category: "知识组织", objective: "多维知识分类", successMetric: "分类准确率 ≥ 95%" },
      { title: "知识搜索", category: "搜索", objective: "智能知识搜索", successMetric: "搜索准确率 ≥ 95%" },
      { title: "协作管理", category: "协作管理", objective: "团队知识协作", successMetric: "协同编辑延迟 < 500ms" },
      { title: "版本管理", category: "版本管理", objective: "知识版本控制", successMetric: "版本回滚时间 < 3s" },
      { title: "审核发布", category: "审核发布", objective: "内容审核工作流", successMetric: "审核周期 < 4小时" },
      { title: "知识分析", category: "分析", objective: "知识使用分析", successMetric: "分析报表生成 < 10s" },
      { title: "系统管理", category: "系统管理", objective: "平台配置", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "内容管理": ["富文本编辑", "Markdown支持", "多媒体嵌入", "表格编辑", "代码高亮", "数学公式"],
      "知识组织": ["树形分类", "标签管理", "空间管理", "知识链接", "目录生成"],
      "知识搜索": ["全文搜索", "高级筛选", "搜索建议", "搜索高亮", "相关推荐"],
      "协作管理": ["评论讨论", "协同编辑", "任务分配", "@提及", "通知提醒"],
      "版本管理": ["版本历史", "差异对比", "版本回滚", "变更摘要"],
      "审核发布": ["审核流程", "发布管理", "定时发布", "发布历史", "草稿管理"],
      "知识分析": ["阅读统计", "搜索分析", "知识健康", "用户分析", "贡献统计"],
      "系统管理": ["权限管理", "模板管理", "导入导出", "API管理", "操作日志"],
    },
    coreKPIs: [
      "知识条目数", "搜索成功率", "知识更新率",
      "用户活跃度", "知识覆盖率", "平均解决时间",
    ],
    coreRoles: [
      "系统管理员", "知识管理员", "内容编辑", "审核员", "普通用户",
    ],
    terminology: [
      { term: "Wiki", meaning: "维基 — 可协同编辑的知识库" },
      { term: "Taxonomy", meaning: "分类法 — 知识的层级分类体系" },
      { term: "Folksonomy", meaning: "大众分类 — 基于用户标签的知识组织" },
    ],
    constraints: [
      "搜索响应时间需 < 200ms",
      "协同编辑需OT/CRDT冲突解决",
      "附件上传大小与格式限制",
      "知识归档/删除需审批",
    ],
    regulations: [
      "个人信息保护法", "数据安全法",
      "知识产权保护法", "信息网络传播权保护条例",
    ],
  }),

  // ──────────────────────────────────────
  // 15. BI — Business Intelligence
  // ──────────────────────────────────────
  BI: Object.freeze({
    name: "BI",
    displayName: "商业智能平台",
    description: "企业数据分析与可视化平台，涵盖数据接入、建模、报表、看板与自助分析",
    category: DOMAIN_CATEGORY.INTELLIGENCE,
    keywords: ["BI", "数据分析", "可视化", "报表", "看板", "ETL", "数据仓库", "OLAP"],
    aliases: ["BI系统", "BI平台", "数据分析平台", "报表平台"],
    coreProcesses: [
      "数据源接入与ETL",
      "数据建模与指标定义",
      "报表设计与发布",
      "可视化看板构建",
      "自助分析与探索",
      "数据权限与安全",
    ],
    coreEntities: [
      "数据源", "数据集", "数据模型", "指标",
      "维度", "报表", "图表", "看板",
      "用户", "数据权限", "调度任务",
    ],
    coreEpics: [
      { title: "数据接入", category: "数据接入", objective: "多源数据统一接入", successMetric: "支持 50+ 数据源类型" },
      { title: "数据建模", category: "数据建模", objective: "灵活数据建模", successMetric: "模型构建时间 < 10分钟" },
      { title: "报表设计", category: "报表", objective: "可视化报表设计器", successMetric: "报表设计效率提升 60%" },
      { title: "可视化看板", category: "可视化", objective: "交互式数据看板", successMetric: "看板渲染 < 3s" },
      { title: "自助分析", category: "分析", objective: "拖拽式自助分析", successMetric: "分析操作响应 < 500ms" },
      { title: "数据权限", category: "安全", objective: "细粒度数据权限", successMetric: "权限变更生效 < 5s" },
      { title: "任务调度", category: "调度", objective: "定时任务调度", successMetric: "调度准时率 ≥ 99.9%" },
      { title: "系统管理", category: "系统管理", objective: "平台管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "数据接入": ["数据库连接", "文件上传", "API接入", "实时数据", "数据清洗", "数据预览"],
      "数据建模": ["关系建模", "指标定义", "计算字段", "数据字典", "模型血缘"],
      "报表设计": ["报表编辑器", "参数过滤", "条件格式", "导出(PDF/Excel)", "报表订阅"],
      "可视化看板": ["图表组件", "看板布局", "联动筛选", "下钻上卷", "移动端适配"],
      "自助分析": ["拖拽分析", "多维透视", "即席查询", "智能推荐"],
      "数据权限": ["行级权限", "列级权限", "数据脱敏", "访问审计"],
      "任务调度": ["定时刷新", "增量更新", "失败重试", "调度监控"],
      "系统管理": ["用户管理", "角色管理", "系统参数", "操作日志", "接口管理"],
    },
    coreKPIs: [
      "报表创建时间", "查询响应时间", "数据刷新及时率",
      "用户活跃度", "数据覆盖率", "平台可用性",
    ],
    coreRoles: [
      "系统管理员", "数据分析师", "业务分析师",
      "报表开发人员", "数据工程师", "决策者",
    ],
    terminology: [
      { term: "ETL", meaning: "数据抽取转换加载 (Extract Transform Load)" },
      { term: "OLAP", meaning: "联机分析处理 (Online Analytical Processing)" },
      { term: "Data Lineage", meaning: "数据血缘 — 数据从源头到消费的流转路径" },
      { term: "KPI/KRI", meaning: "关键绩效/风险指标" },
    ],
    constraints: [
      "大数据量查询（亿级）需秒级响应",
      "数据权限需支持行列级控制",
      "ETL任务需支持失败重试与断点续传",
      "看板需支持实时数据刷新",
    ],
    regulations: [
      "数据安全法", "个人信息保护法",
      "GDPR", "CCPA",
      "行业数据管理规定 (金融/医疗等)",
    ],
  }),

  // ──────────────────────────────────────
  // 16. IoT / Industrial Platform
  // ──────────────────────────────────────
  "IoT Platform": Object.freeze({
    name: "IoT Platform",
    displayName: "物联网/工业互联网平台",
    description: "设备连接管理、数据采集、边缘计算、规则引擎、可视化监控的工业IoT平台",
    category: DOMAIN_CATEGORY.INDUSTRIAL,
    keywords: ["IoT", "物联网", "设备管理", "边缘计算", "SCADA", "PLC", "OPC", "MQTT", "工业互联网", "传感器"],
    aliases: ["IoT平台", "工业互联网平台", "物联网平台"],
    coreProcesses: [
      "设备注册与认证",
      "数据采集与协议适配",
      "规则引擎与告警",
      "边缘计算与本地处理",
      "设备远程控制",
      "数据存储与分析",
      "可视化监控大屏",
    ],
    coreEntities: [
      "设备", "产品/型号", "设备影子", "物模型",
      "数据点", "数据流", "规则", "告警",
      "边缘节点", "OTA升级包", "设备分组",
      "MQTT Topic", "时序数据",
    ],
    coreEpics: [
      { title: "设备管理", category: "设备管理", objective: "设备全生命周期管理", successMetric: "设备注册时间 < 3s" },
      { title: "数据采集", category: "数据采集", objective: "多协议数据接入", successMetric: "支持 20+ 工业协议" },
      { title: "规则引擎", category: "规则引擎", objective: "实时告警与联动", successMetric: "规则触发延迟 < 100ms" },
      { title: "边缘计算", category: "边缘计算", objective: "边缘就地处理", successMetric: "边缘决策延迟 < 10ms" },
      { title: "可视化监控", category: "可视化", objective: "实时设备监控大屏", successMetric: "数据刷新 < 1s" },
      { title: "OTA升级", category: "运维", objective: "远程固件升级", successMetric: "OTA成功率 ≥ 99%" },
      { title: "数据分析", category: "分析", objective: "时序数据分析", successMetric: "支持 100万点/秒 写入" },
      { title: "安全管理", category: "安全", objective: "端到端安全体系", successMetric: "设备认证成功率 ≥ 99.9%" },
      { title: "平台管理", category: "管理", objective: "平台运营管理", successMetric: "系统可配置率 ≥ 90%" },
    ],
    coreFeatures: {
      "设备管理": ["设备注册", "设备认证", "设备影子", "设备分组", "设备标签", "设备日志", "设备拓扑"],
      "数据采集": ["MQTT", "HTTP", "CoAP", "Modbus", "OPC UA", "PLC驱动", "数据解析", "数据转发"],
      "规则引擎": ["规则创建", "条件触发", "联动动作", "告警通知", "规则模板"],
      "边缘计算": ["边缘节点", "本地规则", "数据预处理", "离线缓存", "边缘同步"],
      "可视化监控": ["设备地图", "实时数据", "组态画面", "告警大屏", "趋势图"],
      "OTA升级": ["固件管理", "升级策略", "灰度发布", "升级状态", "回滚"],
      "数据分析": ["时序存储", "数据查询", "聚合分析", "异常检测", "预测维护"],
      "安全管理": ["设备认证", "数据加密", "访问控制", "安全审计"],
      "平台管理": ["产品定义", "物模型", "用户权限", "计费管理", "操作日志"],
    },
    coreKPIs: [
      "设备在线率", "消息吞吐量 (TPS)", "规则触发延迟",
      "数据采集成功率", "OTA升级成功率", "平台可用性",
    ],
    coreRoles: [
      "平台管理员", "设备运维工程师", "数据分析师",
      "解决方案工程师", "安全管理员",
    ],
    terminology: [
      { term: "MQTT", meaning: "消息队列遥测传输协议 — IoT设备与云端的轻量通信协议" },
      { term: "OPC UA", meaning: "OPC统一架构 — 工业自动化互操作标准" },
      { term: "Modbus", meaning: "工业串行通信协议 — PLC/传感器常用协议" },
      { term: "SCADA", meaning: "数据采集与监控系统 (Supervisory Control and Data Acquisition)" },
      { term: "PLC", meaning: "可编程逻辑控制器 (Programmable Logic Controller)" },
      { term: "TPS", meaning: "每秒事务数 (Transactions Per Second)" },
    ],
    constraints: [
      "消息吞吐量 ≥ 100万/秒",
      "规则触发延迟 < 100ms",
      "边缘离线需支持本地缓存",
      "设备入网需安全认证 (X.509/TLS)",
      "时序数据保留策略（冷热分层）",
    ],
    regulations: [
      "网络安全法", "数据安全法",
      "关键信息基础设施安全保护条例",
      "工业互联网安全标准体系",
    ],
  }),
});

// ══════════════════════════════════════════════════════════
// Domain Registry API
// ══════════════════════════════════════════════════════════

/**
 * 获取完整领域注册表。
 * @returns {object} 所有领域定义的只读映射
 */
export function getDomainRegistry() {
  return DOMAINS;
}

/**
 * 获取单个领域定义。
 * @param {string} domainName — 领域名称 (e.g., "ERP", "MES", "CRM")
 * @returns {object|null}
 */
export function getDomain(domainName) {
  return DOMAINS[domainName] || null;
}

/**
 * 列出所有已注册领域名称。
 * @returns {string[]}
 */
export function listDomains() {
  return Object.keys(DOMAINS);
}

/**
 * 按类别筛选领域。
 * @param {string} category — DOMAIN_CATEGORY 值
 * @returns {object[]}
 */
export function getDomainsByCategory(category) {
  return Object.values(DOMAINS).filter(d => d.category === category);
}

/**
 * 搜索领域（按名称或关键词）。
 * @param {string} query
 * @returns {object[]}
 */
export function searchDomains(query) {
  const q = query.toLowerCase();
  return Object.values(DOMAINS).filter(d =>
    d.name.toLowerCase().includes(q) ||
    d.displayName.includes(query) ||
    d.keywords.some(k => k.toLowerCase().includes(q)) ||
    d.aliases.some(a => a.toLowerCase().includes(q))
  );
}

export { DOMAINS };
