// Database Types

export interface Session {
  id: number;
  session_id: string;
  project_id: number;
  user_id: number;
  started_at: Date;
  last_updated: Date;
  conversation: Message[];
  file_changes: FileChange[];
  message_count: number;
  duration_minutes: number;
  file_change_count: number;
  summary?: string;
  total_tokens?: number;
  prompt_tokens?: number;
  completion_tokens?: number;
  estimated_cost_usd?: number;
  primary_ai_model?: string;
  ide_name?: string;
  github_commit_sha?: string;
  github_branch?: string;
}

export interface Message {
  role: string;
  content: string;
  timestamp: Date;
}

export interface FileChange {
  file: string;
  event: string;
  timestamp: Date;
}

export interface WorkCompleted {
  id: number;
  session_id: number;
  project_id: number;
  title: string;
  description?: string;
  category: string;
  files_modified: string[];
  completed_at: Date;
  github_commit_sha?: string;
}

export interface Project {
  id: number;
  name: string;
  workspace_path: string;
  status: string;
  created_at: Date;
}

export interface ArchitecturalDecision {
  id: number;
  project_id: number;
  title: string;
  context?: string;
  decision: string;
  consequences?: string;
  status: string;
  decided_at: Date;
  tags: string[];
}

export interface ApiEndpoint {
  id: number;
  project_id: number;
  method: string;
  path: string;
  description?: string;
  is_active: boolean;
  first_detected: Date;
  last_detected: Date;
}

// Dashboard Stats
export interface DashboardStats {
  totalSessions: number;
  totalCost: number;
  totalTokens: number;
  totalFeatures: number;
  completedFeatures: number;
  totalDuration: number;
}

