Quellcode durchsuchen

feat!: Integrate block modules into the classes endpoint

Sean Blackburn vor 1 Jahr
Ursprung
Commit
8771ae158d

+ 10 - 0
src/components/enums/module-execution-type.yaml

@@ -0,0 +1,10 @@
+type: string
+description: Method, how the module is executed
+oneOf:
+  - title: Semester Weekly
+    const: semester_weekly
+    description: A semester module, that is taught on a weekly basis over a semester
+  - title: blockmodule
+    const: blockmodule
+    description: |
+      A Block module, which is taught over a short timespan (less than a semester).

+ 0 - 5
src/components/enums/teaching-type.yaml

@@ -7,11 +7,6 @@ oneOf:
   - title: Online
     const: online
     description: Exclusively taught online
-  - title: Blockmodule
-    const: blockmodule
-    description: |
-      A module that is taught in a single block over the span of a few weeks, not the
-      entire semester.
   - title: Hybrid
     const: hybrid
     description: Both on site and online

+ 0 - 26
src/components/examples/{semester}/blockclasses.yaml

@@ -1,26 +0,0 @@
-- weekday: null
-  from: 0
-  to: 0
-  class: 5Me
-  name: aem
-  rooms: []
-  lecturers: []
-  teaching_type: blockmodule
-  pages:
-    - 1
-  degree_prg: Maschinenbau
-  part_of_other_classes: []
-  pk: 5Me-aem-b
-- weekday: null
-  from: 0
-  to: 0
-  class: 7KGb
-  name: alges
-  rooms: []
-  lecturers: []
-  teaching_type: blockmodule
-  pages:
-    - 1
-  degree_prg: Kontext GSW
-  part_of_other_classes: []
-  pk: 7KGb-alges-b

+ 0 - 1
src/components/examples/{semester}/config.yaml

@@ -1 +0,0 @@
-blockclass_file: "Blockmodule.xlsx"

+ 2 - 0
src/components/examples/{semester}/{version}/classes.yaml

@@ -8,6 +8,7 @@
   lecturers:
     - Cur
   teaching_type: on_site
+  module_execution_method: semester_weekly
   pages:
     - 1
   degree_prg: Data Science
@@ -23,6 +24,7 @@
   lecturers:
     - Ped
   teaching_type: on_site
+  module_execution_method: semester_weekly
   pages:
     - 1
   degree_prg: Data Science

+ 1 - 0
src/components/examples/{semester}/{version}/config.yaml

@@ -1,3 +1,4 @@
 pdf_version: einschreiben / HS_24_einschr_3
 export_date: 17.06.2024 15:07:00
 parse_date: 04.10.2024 17:45:10
+blockmodule_file: "Blockmodule.xlsx"

+ 0 - 9
src/components/responses/{semester}/blockclasses-200.yaml

@@ -1,9 +0,0 @@
-description: OK
-content:
-  application/json:
-    schema:
-      type: array
-      items:
-        $ref: ../../schemas/{semester}/blockclass.yaml
-    example:
-      $ref: ../../examples/{semester}/blockclasses.yaml

+ 0 - 7
src/components/responses/{semester}/semester-config-200.yaml

@@ -1,7 +0,0 @@
-description: OK
-content:
-  application/json:
-    schema:
-      $ref: ../../schemas/{semester}/semester-config.yaml
-    example:
-      $ref: ../../examples/{semester}/config.yaml

+ 0 - 63
src/components/schemas/{semester}/blockclass.yaml

@@ -1,63 +0,0 @@
-type: object
-description: Single blockclass entry
-properties:
-  weekday:
-    description: Not used
-    type: "null"
-  from:
-    description: Time the module starts in seconds since midnight (not used, always 0)
-    type: integer
-    format: int32
-  to:
-    description: Time the module starts in seconds since midnight (not used, always 0)
-    type: integer
-    format: int32
-  class:
-    description: Class name this block module is part of
-    type: string
-  name:
-    description: Short name of the module
-    type: string
-  rooms:
-    description: The rooms which are reserved for this module
-    type: array
-    items:
-      type: string
-  lecturers:
-    description: The lecturers names that are teaching this module
-    type: array
-    items:
-      type: string
-  teaching_type:
-    description: Type of teaching
-    $ref: ../../enums/teaching-type.yaml
-  pages:
-    description: The pages, on which the module can be found
-    type: array
-    items:
-      type: integer
-      format: int16
-  degree_prg:
-    description: Name of the degree program this module is part of
-    type: string
-  part_of_other_classes:
-    description: List of other classes, where this module is also taught
-    type: array
-    items:
-      type: string
-  pk:
-    description: Unique identifier for this blockmodule
-    type: string
-required:
-  - weekday
-  - from
-  - to
-  - class
-  - name
-  - rooms
-  - lecturers
-  - teaching_type
-  - pages
-  - degree_prg
-  - part_of_other_classes
-  - pk

+ 0 - 10
src/components/schemas/{semester}/semester-config.yaml

@@ -1,10 +0,0 @@
-type: object
-description: Semester configuration / additional information
-properties:
-  blockclass_file:
-    description: Relative path to the blockclass file
-    type:
-      - string
-      - "null"
-required:
-  - blockclass_file

+ 3 - 0
src/components/schemas/{semester}/{version}/class.yaml

@@ -30,6 +30,8 @@ properties:
   teaching_type:
     description: The type of teaching
     $ref: ../../../enums/teaching-type.yaml
+  module_execution_method:
+    $ref: ../../../enums/module-execution-type.yaml
   pages:
     description: List of pages, on which the module can be found in the PDF
     type: array
@@ -56,6 +58,7 @@ required:
   - rooms
   - lecturers
   - teaching_type
+  - module_execution_method
   - pages
   - degree_prg
   - part_of_other_classes

+ 6 - 0
src/components/schemas/{semester}/{version}/semester-version-config.yaml

@@ -15,7 +15,13 @@ properties:
     format: dd.mm.yyyy HH:MM:SS
     type: string
     example: "04.10.2024 17:45:10"
+  blockmodule_file:
+    description: Name of the blockmodule file
+    type:
+      - string
+      - "null"
 required:
   - pdf_version
   - export_date
   - parse_date
+  - blockmodule_file

+ 0 - 4
src/openapi.yaml

@@ -23,12 +23,8 @@ paths:
     $ref: ./paths/lecturers.yaml
   /api/module-history:
     $ref: ./paths/module-history.yaml
-  /api/{semester}/config:
-    $ref: ./paths/{semester}/config.yaml
   /api/{semester}/changes:
     $ref: ./paths/{semester}/changes.yaml
-  /api/{semester}/blockclasses:
-    $ref: ./paths/{semester}/blockclasses.yaml
   /api/{semester}/{version}/classes:
     $ref: ./paths/{semester}/{version}/classes.yaml
   /api/{semester}/{version}/config:

+ 0 - 12
src/paths/{semester}/blockclasses.yaml

@@ -1,12 +0,0 @@
-get:
-  operationId: GetSemesterBlockclasses
-  summary: >-
-    A list of all blockclasses for this semester.
-  security: []
-  tags:
-    - Semester
-  parameters:
-    - $ref: ../../components/parameters/semester.yaml
-  responses:
-    "200":
-      $ref: ../../components/responses/{semester}/blockclasses-200.yaml

+ 0 - 12
src/paths/{semester}/config.yaml

@@ -1,12 +0,0 @@
-get:
-  operationId: GetSemesterConfig
-  summary: >-
-    Configuration / additional information for this semester.
-  security: []
-  tags:
-    - Semester
-  parameters:
-    - $ref: ../../components/parameters/semester.yaml
-  responses:
-    "200":
-      $ref: ../../components/responses/{semester}/semester-config-200.yaml