From ac5f343a009c02cce0df89805b7a02e98282bf93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20=C3=96hlerking?= Date: Fri, 21 Jun 2024 13:50:16 +0200 Subject: [PATCH] add sync of course --- .../oidc/service/schulconnex-course-sync.service.spec.ts | 8 ++++++++ .../oidc/service/schulconnex-course-sync.service.ts | 3 +++ 2 files changed, 11 insertions(+) diff --git a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.spec.ts b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.spec.ts index a662a5d5502..881822cdea6 100644 --- a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.spec.ts +++ b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.spec.ts @@ -88,6 +88,8 @@ describe(SchulconnexCourseSyncService.name, () => { new Course({ ...course.getProps(), name: newGroup.name, + startDate: newGroup.validFrom, + untilDate: newGroup.validUntil, studentIds: [studentId], teacherIds: [teacherId], }), @@ -126,6 +128,8 @@ describe(SchulconnexCourseSyncService.name, () => { new Course({ ...course.getProps(), name: newGroup.name, + startDate: newGroup.validFrom, + untilDate: newGroup.validUntil, studentIds: [], teacherIds: [], }), @@ -164,6 +168,8 @@ describe(SchulconnexCourseSyncService.name, () => { new Course({ ...course.getProps(), name: course.name, + startDate: newGroup.validFrom, + untilDate: newGroup.validUntil, studentIds: [], teacherIds: [], }), @@ -208,6 +214,8 @@ describe(SchulconnexCourseSyncService.name, () => { new Course({ ...course.getProps(), name: course.name, + startDate: newGroup.validFrom, + untilDate: newGroup.validUntil, studentIds: [], teacherIds: [teacherUserId], syncedWithGroup: undefined, diff --git a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.ts b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.ts index bdc853f49a5..04049de68aa 100644 --- a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.ts +++ b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.ts @@ -22,6 +22,9 @@ export class SchulconnexCourseSyncService { course.name = newGroup.name; } + course.startDate = newGroup.validFrom; + course.untilDate = newGroup.validUntil; + const students: GroupUser[] = newGroup.users.filter( (user: GroupUser): boolean => user.roleId === studentRole.id );