import { db } from './index';
import { annotationTypes } from './schema';

export async function seedAnnotationTypes() {
  const defaultTypes = [
    {
      name: 'break_up',
      display_name: 'Break Up',
      color: '#10b981',
      category: 'marker',
      icon: 'arrowUp',
    },
    {
      name: 'break_down',
      display_name: 'Break Down',
      color: '#ef4444',
      category: 'marker',
      icon: 'arrowDown',
    },
    {
      name: 'line',
      display_name: 'Line',
      color: '#3b82f6',
      category: 'line',
      icon: 'line',
    },
  ];

  // Check if types already exist
  const existing = await db.select().from(annotationTypes);

  if (existing.length === 0) {
    await db.insert(annotationTypes).values(defaultTypes);
    console.log('Seeded default annotation types');
  } else {
    console.log('Annotation types already exist, skipping seed');
  }
}
