import { type ChatThread, type RoutingMode } from '../../../generated/prisma';

export interface CreateThreadData {
  userId: string;
  title?: string;
  routingMode?: RoutingMode;
  systemPrompt?: string;
  temperature?: number;
  maxTokens?: number;
  preferredProvider?: string;
  preferredModel?: string;
  contextPackIds?: string[];
}

export interface UpdateThreadData {
  title?: string;
  isPinned?: boolean;
  isArchived?: boolean;
  routingMode?: RoutingMode;
  lastProvider?: string;
  lastModel?: string;
  systemPrompt?: string | null;
  temperature?: number | null;
  maxTokens?: number | null;
  preferredProvider?: string | null;
  preferredModel?: string | null;
  contextPackIds?: string[];
  judgeEnabled?: boolean;
  judgeModel?: string | null;
  useMemory?: boolean;
  useContext?: boolean;
}

export interface ThreadFilters {
  userId: string;
  search?: string;
  isPinned?: boolean;
  isArchived?: boolean;
}

export interface ThreadWithMessageCount extends ChatThread {
  _count: { messages: number };
}

export type SeedThreadInput = {
  userId: string;
  systemPrompt?: string;
  initialUserMessage: string;
  title?: string;
};
