import type { DependencyType } from '@/features/projects/types/project.types';

export const DEPENDENCY_TYPES: DependencyType[] = ['FS', 'SS', 'FF', 'SF'];

export const DEPENDENCY_TYPE_LABELS: Record<DependencyType, string> = {
  FS: 'Finish → Start',
  SS: 'Start → Start',
  FF: 'Finish → Finish',
  SF: 'Start → Finish',
};

export const DEPENDENCY_TYPE_TOOLTIPS: Record<DependencyType, string> = {
  FS: 'Finish-to-Start (FS): The predecessor must finish before this item can start.',
  SS: 'Start-to-Start (SS): Both items start at the same time.',
  FF: 'Finish-to-Finish (FF): Both items must finish together.',
  SF: 'Start-to-Finish (SF): This item must start before the predecessor can finish.',
};

export function getDependencyTypeLabel(type: string): string {
  return DEPENDENCY_TYPE_LABELS[type as DependencyType] ?? type;
}

export function getDependencyTypeTooltip(type: string): string {
  return DEPENDENCY_TYPE_TOOLTIPS[type as DependencyType] ?? type;
}
