import type { CompanyId } from '@/core/auth/types';

export type TagCategory =
  | 'project'
  | 'phase'
  | 'activity'
  | 'document-type'
  | 'custom';

/** Display order for categories — project & phase are mandatory */
export const TAG_CATEGORY_ORDER: TagCategory[] = [
  'project',
  'phase',
  'activity',
  'document-type',
  'custom',
];

export const TAG_CATEGORY_LABELS: Record<TagCategory, string> = {
  project: 'Proiect',
  phase: 'Fază',
  activity: 'Activitate',
  'document-type': 'Tip document',
  custom: 'Personalizat',
};

export type TagScope = 'global' | 'module' | 'company';

export interface Tag {
  id: string;
  label: string;
  category: TagCategory;
  color?: string;
  icon?: string;
  scope: TagScope;
  moduleId?: string;
  companyId?: CompanyId;
  /** For hierarchy: parent tag id */
  parentId?: string;
  /** For project tags: numbered code e.g. "B-001", "US-024" */
  projectCode?: string;
  metadata?: Record<string, string>;
  createdAt: string;
  updatedAt?: string;
}
