// 基础答题记录
export interface AnswerRecord {
  date: string;
  price: string;
  holdingStock: string;
  holdingCash: string;
  profitAmount: number;
  profitPercent: number;
  index: number;
}

// 答题内容
export interface QuizContent {
  date: string;
  price: number | string;
  holdingStock: string;
  holdingCash: string;
  userId: number;
}

// 题目状态
export interface QuizState {
  date: string;
  price: number | string;
  id?: string; // 新增可选id字段
  gain?: number; // 单日涨幅
}

export type ExamSocketMessageType = 'question' | 'answer' | 'settlement' | 'submit' | 'restart';

// Socket消息
export interface ExamSocketMessage {
  type: ExamSocketMessageType;
  content: QuizContent;
}

// Socket房间消息
export interface ExamSocketRoomMessage {
  roomId: string;
  message: ExamSocketMessage;
}

// 答案
export interface Answer extends QuizContent {
  profitAmount?: number;
  profitPercent?: number;
  totalProfitAmount?: number;
  totalProfitPercent?: number;
  username?: string;
}

// 教室数据
export interface ClassroomData {
  classroom_no: string;
  status: string;
  training_date: string;
  code: string;
}

// 累计结果
export interface CumulativeResult {
  userId: number;
  username?: string;
  totalProfitAmount: number;
  totalProfitPercent: number;
}