export type AIFeedbackSubjectType =
  | "question"
  | "coach"
  | "explanation"
  | "translation"
  | "narrative"
  | "other";

export type AIFeedbackRating = "up" | "down";

export type AIFeedbackStatus = "open" | "acknowledged" | "fixed" | "dismissed";

export interface AIFeedbackSubmitInput {
  subject_type: AIFeedbackSubjectType;
  subject_id: number;
  rating: AIFeedbackRating;
  comment?: string;
  tags?: string[];
  prompt_key?: string;
  prompt_version?: number;
  ai_log_id?: number;
  entity_id?: number;
  course_id?: number;
}

export interface AIFeedback {
  id: number;
  subject_type: AIFeedbackSubjectType;
  subject_id: number;
  subject_key: string;
  rating: AIFeedbackRating;
  comment: string;
  tags: string[];
  prompt_key: string | null;
  prompt_version: number | null;
  ai_log_id: number | null;
  user_id: number;
  user_name: string;
  entity_id: number | null;
  course_id: number | null;
  status: AIFeedbackStatus;
  create_date: string | null;
  resolved_at: string | null;
  resolution_notes: string;
}

export interface AIFeedbackSummary {
  subject_type: AIFeedbackSubjectType;
  subject_id: number;
  up: number;
  down: number;
  total: number;
  my_rating: AIFeedbackRating | null;
  my_comment: string;
}
