mirror of
https://github.com/UniversityOfHelsinkiCS/oodikone.git
synced 2026-10-12 19:03:39 +03:00
[StudyProgrammes] Replace one instance of substitutions with substitution_groups
This commit is contained in:
@@ -7,8 +7,8 @@ import { CourseModel, CreditModel, EnrollmentModel, OrganizationModel, Programme
|
||||
import logger from '../../util/logger'
|
||||
|
||||
export const getAllProgrammeCourses = async (providerCode: string) => {
|
||||
const courses = await CourseModel.findAll({
|
||||
attributes: ['id', 'code', 'name', 'substitutions'],
|
||||
const courses: Pick<CourseModel, 'id' | 'code' | 'name' | 'substitution_groups'>[] = await CourseModel.findAll({
|
||||
attributes: ['id', 'code', 'name', 'substitution_groups'],
|
||||
include: [
|
||||
{
|
||||
model: OrganizationModel,
|
||||
|
||||
@@ -26,8 +26,9 @@ const getAllStudyProgrammeCourses = async (studyProgramme: string) => {
|
||||
|
||||
for (const course of normalCourses) {
|
||||
courseCodes.add(course.code)
|
||||
if (course.substitutions?.includes(`AY${course.code}`)) {
|
||||
courseCodes.add(`AY${course.code}`)
|
||||
// We want all AY course codes variants, even from partially completed susbtitution groups
|
||||
for (const code of course?.substitution_groups?.flat() ?? []) {
|
||||
if (code === 'AY' + course.code) courseCodes.add(code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +174,8 @@ export const getStudyProgrammeCoursesForStudyTrack = async (
|
||||
}),
|
||||
])
|
||||
|
||||
// console.log("Programme credits:", programmeCredits)
|
||||
|
||||
const openUniStudentHetuMap = await getStudentHetuStateMap(
|
||||
programmeCredits.filter(c => c.variant === 'openUni').map(c => c.studentNumber)
|
||||
)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2021",
|
||||
"lib": ["ES2023"],
|
||||
"target": "ES2024",
|
||||
"lib": ["ES2024"],
|
||||
"allowJs": true,
|
||||
"moduleResolution": "nodenext",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"outDir": "dist",
|
||||
|
||||
Reference in New Issue
Block a user