- Made it so, if chosen, the user will only get speaking exams with their chosen gender; - Added the ability for speaking exams to select a gender when generating;
146 lines
3.3 KiB
TypeScript
146 lines
3.3 KiB
TypeScript
import {Module} from ".";
|
|
import {InstructorGender} from "./exam";
|
|
|
|
export type User = StudentUser | TeacherUser | CorporateUser | AgentUser | AdminUser | DeveloperUser;
|
|
|
|
export interface BasicUser {
|
|
email: string;
|
|
name: string;
|
|
profilePicture: string;
|
|
id: string;
|
|
isFirstLogin: boolean;
|
|
focus: "academic" | "general";
|
|
levels: {[key in Module]: number};
|
|
desiredLevels: {[key in Module]: number};
|
|
type: Type;
|
|
bio: string;
|
|
isVerified: boolean;
|
|
subscriptionExpirationDate?: null | Date;
|
|
registrationDate?: Date;
|
|
status: "active" | "disabled" | "paymentDue";
|
|
}
|
|
|
|
export interface StudentUser extends BasicUser {
|
|
type: "student";
|
|
preferredGender?: InstructorGender;
|
|
demographicInformation?: DemographicInformation;
|
|
}
|
|
|
|
export interface TeacherUser extends BasicUser {
|
|
type: "teacher";
|
|
demographicInformation?: DemographicInformation;
|
|
}
|
|
|
|
export interface CorporateUser extends BasicUser {
|
|
type: "corporate";
|
|
corporateInformation: CorporateInformation;
|
|
demographicInformation?: DemographicCorporateInformation;
|
|
}
|
|
|
|
export interface AgentUser extends BasicUser {
|
|
type: "agent";
|
|
agentInformation: AgentInformation;
|
|
demographicInformation?: DemographicInformation;
|
|
}
|
|
|
|
export interface AdminUser extends BasicUser {
|
|
type: "admin";
|
|
demographicInformation?: DemographicInformation;
|
|
}
|
|
|
|
export interface DeveloperUser extends BasicUser {
|
|
type: "developer";
|
|
preferredGender?: InstructorGender;
|
|
demographicInformation?: DemographicInformation;
|
|
}
|
|
|
|
export interface CorporateInformation {
|
|
companyInformation: CompanyInformation;
|
|
monthlyDuration: number;
|
|
payment?: {
|
|
value: number;
|
|
currency: string;
|
|
commission: number;
|
|
};
|
|
referralAgent?: string;
|
|
}
|
|
|
|
export interface AgentInformation {
|
|
companyName: string;
|
|
commercialRegistration: string;
|
|
}
|
|
|
|
export interface CompanyInformation {
|
|
name: string;
|
|
userAmount: number;
|
|
}
|
|
|
|
export interface DemographicInformation {
|
|
country: string;
|
|
phone: string;
|
|
gender: Gender;
|
|
employment: EmploymentStatus;
|
|
passport_id?: string;
|
|
timezone?: string;
|
|
}
|
|
|
|
export interface DemographicCorporateInformation {
|
|
country: string;
|
|
phone: string;
|
|
gender: Gender;
|
|
position: string;
|
|
timezone?: string;
|
|
}
|
|
|
|
export type Gender = "male" | "female" | "other";
|
|
export type EmploymentStatus = "employed" | "student" | "self-employed" | "unemployed" | "retired" | "other";
|
|
export const EMPLOYMENT_STATUS: {status: EmploymentStatus; label: string}[] = [
|
|
{status: "student", label: "Student"},
|
|
{status: "employed", label: "Employed"},
|
|
{status: "unemployed", label: "Unemployed"},
|
|
{status: "self-employed", label: "Self-employed"},
|
|
{status: "retired", label: "Retired"},
|
|
{status: "other", label: "Other"},
|
|
];
|
|
|
|
export interface Stat {
|
|
id: string;
|
|
user: string;
|
|
exam: string;
|
|
exercise: string;
|
|
session: string;
|
|
date: number;
|
|
module: Module;
|
|
solutions: any[];
|
|
type: string;
|
|
timeSpent?: number;
|
|
assignment?: string;
|
|
score: {
|
|
correct: number;
|
|
total: number;
|
|
missing: number;
|
|
};
|
|
}
|
|
|
|
export interface Group {
|
|
admin: string;
|
|
name: string;
|
|
participants: string[];
|
|
id: string;
|
|
disableEditing?: boolean;
|
|
}
|
|
|
|
export interface Code {
|
|
code: string;
|
|
creator: string;
|
|
expiryDate: Date;
|
|
type: Type;
|
|
userId?: string;
|
|
email?: string;
|
|
name?: string;
|
|
passport_id?: string;
|
|
}
|
|
|
|
export type Type = "student" | "teacher" | "corporate" | "admin" | "developer" | "agent";
|
|
export const userTypes: Type[] = ["student", "teacher", "corporate", "admin", "developer", "agent"];
|