import {Module} from ".";
import {Type} from "./user";

export interface Ticket {
	id: string;
	date: string;
	status: TicketStatus;
	type: TicketType;
	reporter: TicketReporter;
	reportedFrom: string;
	description: string;
	subject: string;
	assignedTo?: string;
	examInformation?: {
		exams: string[];
		exam: string;
		selectedModules: Module[];
		moduleIndex: number;
		partIndex: number;
		exerciseIndex: number;
		questionIndex: number;
	};
}

export interface TicketReporter {
	id: string;
	name: string;
	email: string;
	type: Type;
}

export type TicketType = "feedback" | "bug" | "help";
export const TicketTypeLabel: {[key in TicketType]: string} = {
	feedback: "Feedback",
	bug: "Bug",
	help: "Help",
};

export type TicketStatus = "submitted" | "in-progress" | "completed";
export const TicketStatusLabel: {[key in TicketStatus]: string} = {
	submitted: "Submitted",
	"in-progress": "In Progress",
	completed: "Completed",
};

export interface TicketWithCorporate extends Ticket {
	corporate?: string;
}
