Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for NUPath #656

Merged
merged 6 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/api-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
ForgotPasswordDto,
ResetPasswordDto,
courseToString,
NUPathEnum,
} from "@graduate/common";
import { ClassConstructor, plainToInstance } from "class-transformer";

Expand Down Expand Up @@ -131,6 +132,7 @@ interface SearchClass {
subject: string;
prereqs?: INEUAndReq | INEUOrReq;
coreqs?: INEUAndReq | INEUOrReq;
nupath?: NUPathEnum[];
maxCredits: number;
minCredits: number;
termId: string;
Expand Down Expand Up @@ -188,6 +190,7 @@ function occurrenceToCourse(occurrence: SearchClass): ScheduleCourse2<null> {
numCreditsMin: occurrence.minCredits,
prereqs: occurrence.prereqs,
coreqs: occurrence.coreqs,
nupaths: occurrence.nupath,
id: null,
};
}
Expand Down Expand Up @@ -228,6 +231,7 @@ class SearchAPIClient {
minCredits
prereqs
coreqs
nupath
}
}
}`,
Expand Down Expand Up @@ -268,6 +272,7 @@ class SearchAPIClient {
maxCredits
prereqs
coreqs
nupath
termId
}
}
Expand Down Expand Up @@ -352,7 +357,7 @@ class SearchAPIClient {
search(termId:"${termId}", query: "${searchQuery}", classIdRange: {min: ${minIndex}, max: ${maxIndex}}) {
totalCount
pageInfo { hasNextPage }
nodes { ... on ClassOccurrence { name subject maxCredits minCredits prereqs coreqs classId
nodes { ... on ClassOccurrence { name subject maxCredits minCredits prereqs coreqs nupath classId
}
}
}
Expand All @@ -370,6 +375,7 @@ class SearchAPIClient {
subject: result.subject,
prereqs: result.prereqs,
coreqs: result.coreqs,
nupaths: result.nupath,
numCreditsMin: result.minCredits,
numCreditsMax: result.maxCredits,
};
Expand Down
34 changes: 17 additions & 17 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
/**
* Describes an abbreviation for one of Northeastern's NUPath academic breadth
* requirements. Each two-character NUPath directly corresponds to
* Northeastern's abbreviation of the requirement.
* Describes the term SearchNEU uses for each of Northeastern's NUPath academic
* breadth requirements.
*/
export enum NUPathEnum {
ND = "ND",
EI = "EI",
IC = "IC",
FQ = "FQ",
SI = "SI",
AD = "AD",
DD = "DD",
ER = "ER",
WF = "WF",
WD = "WD",
WI = "WI",
EX = "EX",
CE = "CE",
ND = "Natural and Designed World",
EI = "Creative Expression/Innovation",
IC = "Interpreting Culture",
FQ = "Formal and Quantitative Reasoning",
SI = "Societies and Institutions",
AD = "Analyzing/Using Data",
DD = "Difference and Diversity",
ER = "Ethical Reasoning",
WF = "1st Yr Writing",
WD = "Adv Writ Dscpl",
WI = "Writing Intensive",
EX = "Integration Experience",
CE = "Capstone Experience",
}

/**
Expand All @@ -40,7 +39,6 @@ export enum StatusEnum {
HOVERCOOP = "HOVERCOOP",
}

export type NUPath = keyof typeof NUPathEnum;
export type Status = keyof typeof StatusEnum;
export type Season = keyof typeof SeasonEnum;

Expand Down Expand Up @@ -319,6 +317,7 @@ export interface ScheduleTerm2<T> {
* @param subject The subject of this course (CS, DS, etc)
* @param prereqs The prerequisites for this course
* @param coreqs The corequisites for this course
* @param nupaths The nupaths this course fulfills
* @param numCreditsMin The minimum number of credits this course gives
* @param numCreditsMax The maximum number of credits this course gives
* @param id Unique id used as a book keeping field for dnd.
Expand All @@ -329,6 +328,7 @@ export interface ScheduleCourse2<T> {
subject: string;
prereqs?: INEUAndReq | INEUOrReq;
coreqs?: INEUAndReq | INEUOrReq;
nupaths?: NUPathEnum[];
numCreditsMin: number;
numCreditsMax: number;
id: T;
Expand Down