// DTO 基础类型 — 认证/用户/ApiKey/产品/标杆/违禁词（按 API契约§3）

// 认证 & 用户
export type UserRole = 'admin' | 'supervisor' | 'operator';

export interface User {
  id: number;
  username: string;
  email: string;
  current_workspace_id: number;
  role: UserRole;
}

export interface Workspace {
  id: number;
  name: string;
  slug: string;
}

export interface AuthMeResponse extends User {
  workspace: Workspace;
}

export interface LoginRequest { username: string; password: string; }
export interface LoginResponse { token: string; user: User; }
export interface SwitchWorkspaceRequest { workspace_id: number; }
export interface SwitchWorkspaceResponse { current_workspace_id: number; role: string; token: string; }

// API Key（不显余额，CLAUDE.md红线）
export interface ApiKey {
  id: number;
  provider: string;
  key_last4: string;
  created_at: string;
}

export interface CreateApiKeyRequest { provider: string; api_key: string; }

// 产品档案
export interface Product {
  id: number;
  name: string;
  category: string;
  source: 'preset' | 'custom';
  selling_points: string[];
  style_tone: string;
  text_angles: string[];
  custom_prompt: string | null;
  banned_word_ids: number[];
  image_path: string | null;   // 产品参考图路径（铁律：生图带产品图）
}

export interface CreateProductRequest {
  name: string;
  category: string;
  source: 'preset' | 'custom';
  selling_points: string[];
  style_tone: string;
  text_angles: string[];
  custom_prompt: string | null;
  banned_word_ids: number[];
}

// 标杆笔记
export interface Benchmark {
  id: number;
  screenshot_url: string;
  highlights: string;
  link_url: string | null;
}

export interface CreateBenchmarkRequest {
  screenshot_url: string;
  highlights: string;
  link_url: string | null;
}

// 违禁词
export type BannedWordLevel = 'auto_fix' | 'soft_warn' | 'hard_block';

export interface BannedWord {
  id: number;
  word: string;
  level: BannedWordLevel;
  replacement: string | null;
  updatable: boolean;
  workspace_id: number;
}

export interface CreateBannedWordRequest {
  word: string;
  level: BannedWordLevel;
  replacement: string | null;
  updatable: boolean;
}
