/**
 * AI 어시스턴트 API 응답/요청 타입 (workspace_assistant 백엔드 연동)
 */

export interface AiAssistantUser {
  id: number;
  email: string;
  name: string;
  role: "user" | "admin";
  status?: string;
  plan?: string;
  monthlyTokenLimit?: number;
  createdAt?: string;
}

export interface AiAssistantAuthState {
  user: AiAssistantUser;
  accessToken: string;
  refreshToken: string;
}

export interface UsageSummary {
  usage?: {
    today?: { tokens?: number; requests?: number };
    monthly?: { totalTokens?: number; totalCost?: number };
  };
  limit?: { monthly?: number };
  plan?: string;
}

export interface ApiKeyItem {
  id: number;
  name: string;
  keyPrefix: string;
  status: string;
  usageCount?: number;
  lastUsedAt?: string | null;
  createdAt: string;
}

export interface UsageLogItem {
  id: number;
  success: boolean;
  providerName?: string;
  modelName?: string;
  promptTokens?: number;
  completionTokens?: number;
  totalTokens?: number;
  costUsd?: number;
  responseTimeMs?: number;
  createdAt: string;
}

export interface AdminStats {
  users?: { total?: number; active?: number };
  apiKeys?: { total?: number };
  providers?: { active?: number };
}

export interface LlmProvider {
  id: number;
  displayName: string;
  modelName: string;
  apiKey?: string;
  priority: number;
  maxTokens?: number;
  temperature?: number;
  isActive: boolean;
  costPer1kInputTokens?: number;
}
