From 7bea355ce1f45ac5e958fe7d56828104903a0ec3 Mon Sep 17 00:00:00 2001 From: hirst Date: Fri, 6 Sep 2024 20:07:32 +0200 Subject: [PATCH] it gets worse before it gets better --- documentation/diagrams/erdClassroom.mmd | 88 +++++++++++++++++++------ 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/documentation/diagrams/erdClassroom.mmd b/documentation/diagrams/erdClassroom.mmd index 598f3ea..df29e4d 100644 --- a/documentation/diagrams/erdClassroom.mmd +++ b/documentation/diagrams/erdClassroom.mmd @@ -3,36 +3,86 @@ title: Classroom --- erDiagram - PERSON ||--|| STUDENT : becomes - PERSON ||--|| TEACHER : becomes - PERSON ||--|| ADMIN : becomes + USER ||--o{ USER_CLASSROOM : "part of" + USER_CLASSROOM }o--|| CLASSROOM : allows + USER ||--|| STUDENT : is + USER ||--|| ADMIN : is + USER ||--|| TEACHER : is - TEACHER |o--o{ CLASSROOM : makes - TEACHER }o--o{ ASSIGMENT : makes - TEACHER ||--o{ "TEACHER-STUDENT CHAT" : "part of" - TEACHER }o--o{ MATERIALS : makes - TEACHER ||--|{ ROLES : has - TEACHER ||--o{ QUIZ : makes +%% TEACHER }o--o{ CLASSROOM : creates + TEACHER ||--o{ QUIZ : creates +%% TEACHER }o--o{ ASSIGMENT : makes + ROLES }|--|| TEACHER : has QUIZ ||--|{ QUESTION : contains - ASSIGMENT }o--o{ STUDENT : gets +%% STUDENT }o--o{ ASSIGMENT : gets - MATERIALS }o--|| ASSIGMENT : contains - MATERIALS }|--|| DRIVE : accesses + "TEACHER-STUDENT CHAT" ||--|| CLASSROOM : contains - CLASSROOM }o--o{ STUDENT : has - CLASSROOM ||--|| "TEACHER-STUDENT CHAT" : contains + MATERIAL }o--|| ASSIGMENT : contains + DRIVE ||--|{ MATERIAL : accesses + +%% STUDENT }o--o{ CLASSROOM : "part of" + "TEACHER-STUDENT CHAT" }o--|| TEACHER : "part of" CLASSROOM ||--o{ ASSIGMENT : contains ASSIGMENT ||--o| CHAT : has - CHAT ||--|{ STUDENT : "part of" + STUDENT ||--|{ CHAT : "part of" - STUDENT ||--o{ "TEACHER-STUDENT CHAT" : "part of" + STUDENT ||--o{ "TEACHER-STUDENT CHAT" : "part of" STUDENT ||--o{ ROLES : has - ADMIN ||--o{ ROLES : creates - STUDENT ||--|| DRIVE : "uploads to" TEACHER ||--|| DRIVE : "uploads to" - ADMIN ||--|| DRIVE : "uploads to" \ No newline at end of file +%% TEACHER }o--o{ MATERIAL : makes + ADMIN ||--o{ ROLES : creates + ADMIN ||--|| DRIVE : "uploads to" + + USER ||--o{ TEACHER_MATERIAL : "part of" + TEACHER_MATERIAL }o--|| MATERIAL : allows + + USER ||--o{ USER_ASSIGNMENT : "part of" + USER_ASSIGNMENT }o--|| ASSIGMENT : allows + + + %% Connection tables + USER_CLASSROOM { + uuid userId PK, FK + uuid classroomId PK, FK + } + + USER_ASSIGNMENT { + uuid userId PK, FK + uuid assigmentId PK, FK + } + + TEACHER_MATERIAL { + uuid userId PK, FK + uuid materialId PK, FK + } + + + %% Definitions of attributes + USER { + uuid userId PK + %% TODO figure out what keycloak gives as an identifier + uuid keyCloakId FK + enum userType + string name + string nickname + string email + } + + TEACHER { + %% uuid userId FK + } + + CLASSROOM { + uuid classroomId PK + uuid creatorId FK + } + + ASSIGMENT { + uuid assigmentId PK, FK + } \ No newline at end of file