export interface User {
	email: string;
	pseudo: string;
	firstname: string;
	lastname: string;
	description: string;
	avatar: string;
	groups: Group[];
	score: number;
	tries: number;
	completions: number;
	rank: number;
	completionsList: Completion[];
	badges: Badge[] | null;
}

export interface Badge {
	name: string;
	level: number;
	logo: string;
}

export interface Completion {
	puzzleName: string;
	tries: number;
	score: number;
}

export interface Group {
	id: number;
	name: string;
	chapter?: number;
	puzzle?: number;
}

export interface Puzzle {
	id: number;
	name: string;
	content: string;
	scoreMax: number;
	show: boolean;
	tags: Tag[] | null;
	tries?: number;
	score?: number;
}

export interface Chapter {
	id: number;
	name: string;
	puzzles: Puzzle[];
	show?: boolean;
}

export interface Tag {
	name: string;
}

export interface Leaderboard {
	score: number;
	tries: number;
	completions: number;
	pseudo: string;
	groups: Group[];
	rank: number;
}

export interface LeaderboardEvent {
	start_date: string;
	end_date: string;
	groups: [
		{
			name: string;
			rank: number;
			players: [
				{
					pseudo: string;
					tries: number;
					completion: number;
					score: number;
				}
			];
		}
	];
}
