fixup! Улучшение конвертера расписания для групп в расписание для преподавателей

This commit is contained in:
2025-03-20 04:15:56 +04:00
parent 4d9b790c93
commit 8c3f83ed00
3 changed files with 7 additions and 6 deletions

1
package-lock.json generated
View File

@@ -30,7 +30,6 @@
"firebase-admin": "^13.0.2", "firebase-admin": "^13.0.2",
"jsdom": "^26.0.0", "jsdom": "^26.0.0",
"jsonwebtoken": "^9.0.2", "jsonwebtoken": "^9.0.2",
"lodash": "^4.17.21",
"object-hash": "^3.0.0", "object-hash": "^3.0.0",
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1", "rxjs": "^7.8.1",

View File

@@ -42,7 +42,6 @@
"firebase-admin": "^13.0.2", "firebase-admin": "^13.0.2",
"jsdom": "^26.0.0", "jsdom": "^26.0.0",
"jsonwebtoken": "^9.0.2", "jsonwebtoken": "^9.0.2",
"lodash": "^4.17.21",
"object-hash": "^3.0.0", "object-hash": "^3.0.0",
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1", "rxjs": "^7.8.1",

View File

@@ -4,7 +4,6 @@ import * as XLSX from "xlsx";
import { Range, WorkSheet } from "xlsx"; import { Range, WorkSheet } from "xlsx";
import { toNormalString, trimAll } from "../../../utility/string.util"; import { toNormalString, trimAll } from "../../../utility/string.util";
import { plainToInstance, Type } from "class-transformer"; import { plainToInstance, Type } from "class-transformer";
import * as objectHash from "object-hash";
import LessonTime from "../../entities/lesson-time.entity"; import LessonTime from "../../entities/lesson-time.entity";
import { LessonType } from "../../enum/lesson-type.enum"; import { LessonType } from "../../enum/lesson-type.enum";
import LessonSubGroup from "../../entities/lesson-sub-group.entity"; import LessonSubGroup from "../../entities/lesson-sub-group.entity";
@@ -24,7 +23,8 @@ import {
} from "class-validator"; } from "class-validator";
import { ClassProperties } from "../../../utility/class-trasformer/class-transformer-ctor"; import { ClassProperties } from "../../../utility/class-trasformer/class-transformer-ctor";
import { ToMap } from "create-map-transform-fn"; import { ToMap } from "create-map-transform-fn";
import cloneDeep from "lodash/cloneDeep";
import * as objectHash from "object-hash";
type InternalId = { type InternalId = {
/** /**
@@ -369,7 +369,7 @@ export class ScheduleParser {
}); });
})(); })();
const cloneDays = () => cloneDeep(days); const cloneDays = () => structuredClone(days);
for (const group of groups.values()) { for (const group of groups.values()) {
group.days.forEach((day, dayIndex) => { group.days.forEach((day, dayIndex) => {
@@ -391,7 +391,10 @@ export class ScheduleParser {
dayIndex dayIndex
]; ];
const lesson = cloneDeep(groupLesson) as TeacherLesson; const lesson = structuredClone(
groupLesson,
) as TeacherLesson;
lesson.group = group.name; lesson.group = group.name;
teacherDay.lessons.push(lesson); teacherDay.lessons.push(lesson);