84 lines
2.0 KiB
TypeScript
84 lines
2.0 KiB
TypeScript
import {Module} from ".";
|
|
|
|
export interface User {
|
|
email: string;
|
|
name: string;
|
|
profilePicture: string;
|
|
id: string;
|
|
experience: number;
|
|
isFirstLogin: boolean;
|
|
focus: "academic" | "general";
|
|
levels: {[key in Module]: number};
|
|
desiredLevels: {[key in Module]: number};
|
|
type: Type;
|
|
bio: string;
|
|
isVerified: boolean;
|
|
demographicInformation?: DemographicInformation;
|
|
corporateInformation?: CorporateInformation;
|
|
subscriptionExpirationDate?: null | Date;
|
|
registrationDate?: Date;
|
|
status: "active" | "disabled" | "paymentDue";
|
|
}
|
|
|
|
export interface CorporateInformation {
|
|
companyInformation: CompanyInformation;
|
|
monthlyDuration: number;
|
|
payment?: {
|
|
value: number;
|
|
currency: string;
|
|
};
|
|
referralAgent?: string;
|
|
}
|
|
|
|
export interface CompanyInformation {
|
|
name: string;
|
|
userAmount: number;
|
|
}
|
|
|
|
export interface DemographicInformation {
|
|
country: string;
|
|
phone: string;
|
|
gender: Gender;
|
|
employment: EmploymentStatus;
|
|
}
|
|
|
|
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 {
|
|
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 type Type = "student" | "teacher" | "corporate" | "admin" | "developer" | "agent";
|
|
export const userTypes: Type[] = ["student", "teacher", "corporate", "admin", "developer", "agent"];
|