import type { PersonalityDirectoryFilterGroup as PersonalityDirectoryFilterGroupValue } from '@/shared/constants/personality';

export interface PersonalityQuizResultViewModel {
  readonly personalityType: string;
  readonly quizAnswers: Record<number, string>;
  readonly updatedAt: string;
}

export interface PersonalityQuizSubmission {
  readonly personalityType: string;
  readonly quizAnswers: Record<number, string>;
}

export type PersonalityQuizResultTab = 'overview' | 'relationships' | 'language';

export interface PersonalityQuizFeature {
  readonly id: string;
  readonly label: string;
  readonly description: string;
  readonly toneClass: string;
}

export interface PersonalityDimensionProgress {
  readonly dimension: 'EI' | 'SN' | 'TF' | 'JP';
  readonly label: string;
  readonly answeredCount: number;
  readonly totalCount: number;
  readonly current: boolean;
}

export interface PersonalityTypeBreakdownItem {
  readonly letter: string;
  readonly label: string;
  readonly fullLabel: string;
}

export interface PersonalityRelationshipTip {
  readonly type: string;
  readonly tip: string;
}

export interface PersonalityQuizWorkflowInput {
  readonly onResult?: (code: string, answers: Record<number, string>) => void | Promise<void>;
  readonly savedType?: string | null;
  readonly savedAnswers?: Record<number, string> | null;
}

export type PersonalityDirectoryFilterGroup = PersonalityDirectoryFilterGroupValue;

export type PersonalityDirectorySection = 'overview' | 'relationships' | 'language';

export interface PersonalityDirectoryPage {
  readonly personalityTypes: readonly import('@/shared/constants/personalityCatalog').PersonalityType[];
  readonly filteredTypes: readonly import('@/shared/constants/personalityCatalog').PersonalityType[];
  readonly expandedType: string | null;
  readonly searchQuery: string;
  readonly filterGroup: PersonalityDirectoryFilterGroup;
  readonly expandedSections: Readonly<Record<string, PersonalityDirectorySection>>;
  readonly isLoading: boolean;
  readonly error: unknown;
  readonly groupDescription: string;
  readonly setSearchQuery: (query: string) => void;
  readonly setFilterGroup: (group: PersonalityDirectoryFilterGroup) => void;
  readonly toggleExpand: (code: string) => void;
  readonly getActiveSection: (code: string) => PersonalityDirectorySection;
  readonly setActiveSection: (code: string, section: PersonalityDirectorySection) => void;
  readonly clearFilters: () => void;
}
