import { UserRole } from '@/shared/types/app';

export interface SafetyQuizResultDto {
  readonly id: string;
  readonly quiz_id: string;
  readonly quiz_title: string;
  readonly week_of: string;
  readonly score: number;
  readonly total_questions: number;
  readonly answers: readonly number[];
  readonly user_name: string;
  readonly user_role: UserRole;
  readonly completed_at: string;
  readonly organizationId: string;
  readonly campusId: string | null;
  readonly userId: string;
  readonly createdAt: string;
  readonly updatedAt: string;
}

export interface SafetyQuizResultCreateDto {
  readonly quiz_id: string;
  readonly quiz_title: string;
  readonly week_of: string;
  readonly score: number;
  readonly total_questions: number;
  readonly answers: readonly number[];
}

export interface SafetyQuizPersonalStatusDto {
  readonly completed: boolean;
  readonly result: SafetyQuizResultDto | null;
}

export interface SafetyQuizCompletionRowDto {
  readonly userId: string;
  readonly name: string;
  readonly email: string;
  readonly avatar: string | null;
  readonly tenantName: string | null;
  readonly tenantLogo: string | null;
  readonly role: UserRole | null;
  readonly status: 'complete' | 'pending';
  readonly result: SafetyQuizResultDto | null;
}

export interface SafetyQuizCompletionSummaryDto {
  readonly totalStaff: number;
  readonly completedCount: number;
  readonly pendingCount: number;
  readonly completionRate: number;
}

export interface SafetyQuizCompletionReportDto {
  readonly summary: SafetyQuizCompletionSummaryDto;
  readonly rows: readonly SafetyQuizCompletionRowDto[];
}
