/**
 * 绩效管理模块权限常量
 * 基于 docs/modules/performance/03-architecture.md 定义
 *
 * 命名规范：
 * - 文档定义的权限使用下划线分隔（如 view_team）
 * - 实现扩展的权限使用冒号分隔（如 view:own）
 */

export const PERFORMANCE_PERMISSIONS = {
  // ==================== 周期管理 ====================
  // 文档定义: performance:cycle:create, performance:cycle:manage
  CYCLE_CREATE: 'performance:cycle:create',
  CYCLE_MANAGE: 'performance:cycle:manage', // 文档规范
  CYCLE_VIEW: 'performance:cycle:view',
  CYCLE_UPDATE: 'performance:cycle:update',
  CYCLE_DELETE: 'performance:cycle:delete',
  CYCLE_PUBLISH: 'performance:cycle:publish',

  // ==================== KPI 管理 ====================
  // 文档定义: performance:kpi:manage, performance:kpi:assign, performance:kpi:evaluate
  KPI_MANAGE: 'performance:kpi:manage',
  KPI_ASSIGN: 'performance:kpi:assign',
  KPI_EVALUATE: 'performance:kpi:evaluate', // 文档规范（经理评估）
  KPI_VIEW: 'performance:kpi:view',
  KPI_VIEW_TEAM: 'performance:kpi:view:team',
  KPI_SELF_EVALUATE: 'performance:kpi:self-evaluate',
  KPI_MANAGER_EVALUATE: 'performance:kpi:manager-evaluate',
  KPI_CONFIRM: 'performance:kpi:confirm',

  // ==================== 360 评估 ====================
  // 文档定义: performance:360:create, performance:360:view_all
  E360_CREATE: 'performance:360:create',
  E360_VIEW_ALL: 'performance:360:view_all', // 文档规范（下划线）
  E360_VIEW: 'performance:360:view',
  E360_VIEW_OWN: 'performance:360:view:own',
  E360_VIEW_TEAM: 'performance:360:view:team',
  E360_UPDATE: 'performance:360:update',
  E360_DELETE: 'performance:360:delete',
  E360_SUBMIT: 'performance:360:submit',
  E360_VIEW_RESULTS: 'performance:360:view:results',

  // ==================== 校准 ====================
  // 文档定义: performance:calibration:manage, performance:calibration:adjust
  CALIBRATION_MANAGE: 'performance:calibration:manage',
  CALIBRATION_ADJUST: 'performance:calibration:adjust',
  CAL_VIEW: 'performance:calibration:view',

  // ==================== 结果与报告 ====================
  // 文档定义: performance:result:publish, performance:report:export
  RESULT_PUBLISH: 'performance:result:publish',
  REPORT_EXPORT: 'performance:report:export', // 文档规范
  RESULT_VIEW: 'performance:result:view',
  RESULT_VIEW_OWN: 'performance:result:view:own',
  RESULT_VIEW_ALL: 'performance:result:view:all',
  RESULT_CALCULATE: 'performance:result:calculate',
  RESULT_EXPORT: 'performance:result:export',

  // ==================== 等级配置 ====================
  GRADE_VIEW: 'performance:grade:view',
  GRADE_CREATE: 'performance:grade:create',
  GRADE_UPDATE: 'performance:grade:update',
  GRADE_DELETE: 'performance:grade:delete',
  GRADE_CONFIG_MANAGE: 'performance:grade-config:manage',

  // ==================== 360 模板 ====================
  E360_TEMPLATE_VIEW: 'performance:360-template:view',
  E360_TEMPLATE_CREATE: 'performance:360-template:create',
  E360_TEMPLATE_UPDATE: 'performance:360-template:update',
  E360_TEMPLATE_DELETE: 'performance:360-template:delete',

  // ==================== 战略目标 ====================
  STRATEGIC_VIEW: 'performance:strategic-objective:view',
  STRATEGIC_CREATE: 'performance:strategic-objective:create',
  STRATEGIC_UPDATE: 'performance:strategic-objective:update',
  STRATEGIC_DELETE: 'performance:strategic-objective:delete',
  STRATEGIC_ASSIGN: 'performance:strategic-objective:assign',

} as const;

export type PerformancePermission =
  (typeof PERFORMANCE_PERMISSIONS)[keyof typeof PERFORMANCE_PERMISSIONS];
