Types
Typescript type descriptions
Common Typesβ
Restriction
β
export type Restriction = {
RestrictionName: string;
Description: string;
};
Course
β
// For inspected SIS courses
export type Course = {
title: string;
number: string;
areas: string;
term: String;
school: string;
department: string;
credits: string;
wi: boolean;
bio: string;
tags: string[];
preReq: string[];
restrictions: Restriction[];
version?: string;
level: string;
};
SISRetrievedCourse
β
export type SISRetrievedCourse = {
title: string;
number: string;
terms: string[];
versions: {
areas: string;
term: string;
school: string;
department: string;
credits: string;
wi: boolean;
bio: string;
level: string;
tags: string[];
preReq: string[];
coReq: string[];
restrictions: any[];
}[];
};
CourseEvals
β
// For course Evals
export type CourseEvals = {
number: string;
prof: string;
rating: string;
summary: string;
term: string;
};
UserCourse
β
// For User courses, which have extra ids with user-specific info and a single term/area that the user chose.
export type UserCourse = {
_id: string;
title: string;
term: SemesterType;
number: string;
department: string;
tags: string[];
area: string;
credits: number;
wi: boolean;
taken: boolean;
ratings: number[];
distribution_ids: string[];
plan_id: string;
user_id: string;
year_id: string;
preReq: string[];
isPlaceholder: boolean;
version: string;
};
Year
β
export type Year = {
_id: string;
name: string;
courses: string[];
plan_id: any;
user_id: string;
year: number;
};
Plan
β
export type Plan = {
_id: string;
name: string;
majors: string[];
distribution_ids: string[];
user_id: string;
numYears: number;
years: Year[];
};
The Plan
type contains fields of
_id
representing the unique id of a student's Plan,
name
representing the name that the user gave to the plan,
distribution_ids
representing the ids of a degrees distributions in requirements
majors
representing an array of majors that the student has,
user_id
representing the id of a user,
numYears
representing how many years the user has planned,
years
represents an array of all semesters that a user takes in a certain year like freshman year
Affiliation
β
type Affiliation = "STUDENT" | "FACULTY" | "STAFF";
Grade
β
type Grade =
| "AE UG Freshman"
| "AE UG Sophomore"
| "AE UG Junior"
| "AE UG Senior"
| "Research Program Coordinator"
| "LECTURER"
| "Student Success Advisor";
User
β
export type User = {
_id: string; //JHED ID
name: string;
email: string;
affiliation: Affiliation; //STUDENT,Β FACULTYΒ orΒ STAFF
school: string;
grade: Grade;
plan_ids: string[];
};
Filter
β
export type Filter = {
area?: string;
tags?: TagType[];
department?: string;
title?: string;
number?: string | string[];
wi?: boolean;
exception?: Filter;
};
SearchExtras
β
export type SearchExtras = {
query: string;
credits: string | null;
areas: AreaType | null;
tags: TagType | null;
term: SemesterType;
year: number;
department: DepartmentType | null;
wi: boolean | null;
levels: string | null;
};
Distribution
β
export type Distribution = {
_id: string;
name: string;
required_credits: number;
min_credits_per_course: number;
description: string;
criteria: string;
fine_requirements?: FineReq[];
user_select?: boolean;
double_count?: boolean;
exception?: string;
planned_credits: number;
courses: string[];
user_id: string;
plan_id: string;
};
SemesterType
β
export type SemesterType =
| "Fall"
| "Spring"
| "Summer"
| "Intersession"
| "All";
DepartmentType
β
export type DepartmentType = typeof all_deps[number];
TagType
β
export type TagType = typeof course_tags[number];
FilterType
β
export type FilterType =
| "credits"
| "distribution"
| "tags"
| "term"
| "year"
| "department"
| "wi"
| "levels";
AreaType
β
export type AreaType = "N" | "S" | "H" | "W" | "E" | "Q";
FineReq
β
export type FineReq = {
required_credits: number;
description: string;
criteria: string;
exclusive?: boolean;
};
DistributionObj
β
export type DistributionObj = {
name: string;
required_credits: number;
min_credits_per_course: number;
description: string;
criteria: string;
fine_requirements?: FineReq[];
user_select?: boolean;
double_count?: boolean;
exception?: string;
};
Major
β
export type Major = {
degree_name: string;
department: string;
total_degree_credit: number;
wi_credit: number;
url: string;
distributions: DistributionObj[];
};
Minor
β
export type Minor = {
degree_name: string;
department: string;
total_degree_credit: number;
wi_credit: number;
url: string;
distributions: DistributionObj[];
};
DroppableType
β
export type DroppableType = {
year: string;
semester: SemesterType;
courses: UserCourse[];
};