Skip to content

Commit

Permalink
wip commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpacaFur committed Apr 14, 2024
1 parent 5dc8e34 commit ccdc350
Show file tree
Hide file tree
Showing 673 changed files with 392,546 additions and 21 deletions.
2 changes: 2 additions & 0 deletions packages/api/src/major/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
raw.initial.html
tokens.initial.json
44 changes: 23 additions & 21 deletions packages/api/src/major/major.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,39 @@ import {
} from "@graduate/common";
import { Injectable, Logger } from "@nestjs/common";
import { formatServiceCtx } from "../utils";
import { SUPPORTED_MAJOR_YEARS, SUPPORTED_MAJORS } from "./majors";
// import { SUPPORTED_MAJOR_YEARS, SUPPORTED_MAJORS } from "./majors";
import { MAJOR_YEARS, MAJORS } from "./majorCollator";

@Injectable()
export class MajorService {
private readonly logger: Logger = new Logger();

findByMajorAndYear(majorName: string, catalogYear: number): Major2 | null {
if (!SUPPORTED_MAJOR_YEARS.includes(catalogYear.toString())) {
this.logger.debug(
{ mesage: "Major year not found", catalogYear },
MajorService.formatMajorServiceCtx("findByMajorAndYear")
);
return null;
}

const { majors, supportedMajorNames } = SUPPORTED_MAJORS[catalogYear];
if (!supportedMajorNames.includes(majorName)) {
this.logger.debug(
{ mesage: "Major within year not found", majorName, catalogYear },
MajorService.formatMajorServiceCtx("findByMajorAndYear")
);
return null;
}

return majors[majorName];
// if (!SUPPORTED_MAJOR_YEARS.includes(catalogYear.toString())) {
// this.logger.debug(
// { mesage: "Major year not found", catalogYear },
// MajorService.formatMajorServiceCtx("findByMajorAndYear")
// );
// return null;
// }

// const { majors, supportedMajorNames } = SUPPORTED_MAJORS[catalogYear];
// if (!supportedMajorNames.includes(majorName)) {
// this.logger.debug(
// { mesage: "Major within year not found", majorName, catalogYear },
// MajorService.formatMajorServiceCtx("findByMajorAndYear")
// );
// return null;
// }

return MAJORS[catalogYear][majorName];
}

getSupportedMajors(): SupportedMajors {
const supportedMajors: SupportedMajors = {};
SUPPORTED_MAJOR_YEARS.forEach((year) => {
const { supportedMajorNames } = SUPPORTED_MAJORS[year];
MAJOR_YEARS.forEach((year) => {
console.log(MAJOR_YEARS, MAJORS);
const supportedMajorNames = Object.keys(MAJORS[year]);

const supportedMajorForYear: SupportedMajorsForYear = {};
supportedMajorNames.forEach((majorName) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
{
"name": "Architectural Studies and Design, BS",
"metadata": {
"verified": false,
"lastEdited": "4/13/2024"
},
"totalCreditsRequired": 132,
"yearVersion": 2021,
"requirementSections": [
{
"type": "SECTION",
"title": "Required Courses",
"requirements": [
{
"type": "COURSE",
"classId": 1110,
"subject": "ARCH"
},
{
"type": "AND",
"courses": [
{
"subject": "ARCH",
"classId": 1310,
"description": "Buildings and Cities, A Global History",
"type": "COURSE"
},
{
"subject": "ARCH",
"classId": 1311,
"description": "Recitation for ARCH 1310",
"type": "COURSE"
}
]
},
{
"type": "COURSE",
"classId": 1120,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 2130,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 2260,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 3450,
"subject": "ARCH"
}
],
"minRequirementCount": 6
},
{
"type": "SECTION",
"title": "Architecture History Elective",
"requirements": [],
"minRequirementCount": 0
},
{
"type": "SECTION",
"title": "Electives",
"requirements": [
{
"type": "XOM",
"numCreditsMin": 8,
"courses": [
{
"type": "COURSE",
"classId": 1370,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 1450,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 2140,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 3351,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 3352,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 3370,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 4850,
"subject": "ARCH"
},
{
"type": "COURSE",
"classId": 5310,
"subject": "ARCH"
}
]
}
],
"minRequirementCount": 1
},
{
"type": "SECTION",
"title": "Art + Design Fundamentals Required",
"requirements": [
{
"type": "COURSE",
"classId": 1122,
"subject": "ARTF"
}
],
"minRequirementCount": 1
},
{
"type": "SECTION",
"title": "Art + Design Fundamentals Elective",
"requirements": [
{
"type": "COURSE",
"classId": 1121,
"subject": "ARTF"
},
{
"type": "AND",
"courses": [
{
"subject": "ARTF",
"classId": 1124,
"description": "Form and Structure",
"type": "COURSE"
},
{
"subject": "ARTF",
"classId": 1125,
"description": "Form and Structure Tools",
"type": "COURSE"
}
]
},
{
"type": "COURSE",
"classId": 2220,
"subject": "ARTF"
},
{
"type": "COURSE",
"classId": 2223,
"subject": "ARTF"
}
],
"minRequirementCount": 1
},
{
"type": "SECTION",
"title": "Design Required",
"requirements": [
{
"type": "COURSE",
"classId": 1250,
"subject": "ARTG"
},
{
"type": "COURSE",
"classId": 2250,
"subject": "ARTG"
},
{
"type": "COURSE",
"classId": 3350,
"subject": "ARTG"
},
{
"type": "COURSE",
"classId": 3451,
"subject": "ARTG"
}
],
"minRequirementCount": 4
},
{
"type": "SECTION",
"title": "Design Elective",
"requirements": [],
"minRequirementCount": 0
},
{
"type": "SECTION",
"title": "Art + Design History Elective",
"requirements": [],
"minRequirementCount": 0
},
{
"type": "SECTION",
"title": "Art + Design Elective",
"requirements": [],
"minRequirementCount": 0
},
{
"type": "SECTION",
"title": "Degree Capstone Project",
"requirements": [
{
"type": "COURSE",
"classId": 4550,
"subject": "ARTG"
}
],
"minRequirementCount": 1
},
{
"type": "SECTION",
"title": "Design Option",
"requirements": [],
"minRequirementCount": 0
},
{
"type": "SECTION",
"title": "Interaction Design Option",
"requirements": [
{
"type": "COURSE",
"classId": 2400,
"subject": "ARTG"
},
{
"type": "COURSE",
"classId": 3700,
"subject": "ARTG"
}
],
"minRequirementCount": 2
},
{
"type": "SECTION",
"title": "Graphic and Information Design Option",
"requirements": [
{
"type": "COURSE",
"classId": 2252,
"subject": "ARTG"
},
{
"type": "COURSE",
"classId": 3450,
"subject": "ARTG"
}
],
"minRequirementCount": 2
},
{
"type": "SECTION",
"title": "Experience Design Option",
"requirements": [
{
"type": "COURSE",
"classId": 3462,
"subject": "ARTG"
},
{
"type": "COURSE",
"classId": 3463,
"subject": "ARTG"
}
],
"minRequirementCount": 2
},
{
"type": "SECTION",
"title": "Integrative Requirement",
"requirements": [
{
"type": "COURSE",
"classId": 4550,
"subject": "ARTG"
}
],
"minRequirementCount": 1
}
],
"concentrations": {
"minOptions": 0,
"concentrationOptions": []
}
}
Loading

0 comments on commit ccdc350

Please sign in to comment.