export type Stage = 'requirement' | 'product_design' | 'ui_design' | 'dev' | 'testing' | 'bug';

export type Role = 'product' | 'ui' | 'frontend' | 'backend' | 'testing';

export const STAGES: { key: Stage; label: string }[] = [
  { key: 'requirement', label: '调研' },
  { key: 'product_design', label: '产品设计' },
  { key: 'ui_design', label: 'UI 设计' },
  { key: 'dev', label: '开发' },
  { key: 'testing', label: '测试' },
  { key: 'bug', label: 'BUG' },
];

export const STAGE_INDEX: Record<Stage, number> = STAGES.reduce(
  (acc, s, i) => ({ ...acc, [s.key]: i }),
  {} as Record<Stage, number>,
);

export const STAGE_LABEL: Record<Stage, string> = STAGES.reduce(
  (acc, s) => ({ ...acc, [s.key]: s.label }),
  {} as Record<Stage, string>,
);

export const ROLES: { key: Role; label: string }[] = [
  { key: 'product', label: '产品' },
  { key: 'ui', label: 'UI' },
  { key: 'frontend', label: '前端' },
  { key: 'backend', label: '后端' },
  { key: 'testing', label: '测试' },
];

export const ROLE_LABEL: Record<Role, string> = ROLES.reduce(
  (acc, r) => ({ ...acc, [r.key]: r.label }),
  {} as Record<Role, string>,
);
