export type UserRole = "admin" | "user";

export interface AuthUser {
  id: number;
  username: string;
  role: UserRole;
}

export interface UserRow {
  id: number;
  username: string;
  password_hash: string;
  role: UserRole;
  enabled: number;
  expires_at: string | null;
  created_at: string;
  updated_at: string;
}

export interface FolderRow {
  id: number;
  parent_id: number | null;
  name: string;
  path: string;
  library_type: "system" | "user";
  owner_user_id: number | null;
  is_system: number;
  owner_username?: string | null;
  model_count?: number;
  created_at: string;
  updated_at: string;
}

export interface ModelRow {
  id: number;
  folder_id: number;
  brand_id: number | null;
  type_id: number | null;
  name: string;
  original_filename: string;
  file_path: string;
  library_type: "system" | "user";
  owner_user_id: number | null;
  storage_provider: "local" | "cos";
  file_size: number;
  thumbnail_path: string | null;
  thumbnail_provider: "local" | "cos" | null;
  operation_tree: string;
  brand_name?: string | null;
  type_name?: string | null;
  created_at: string;
  updated_at: string;
}

export interface DictionaryRow {
  id: number;
  name: string;
}
