docs(backend): Assignments swagger annotaties
This commit is contained in:
parent
41dcb57b25
commit
38acfa6a4a
4 changed files with 206 additions and 1 deletions
|
@ -10,6 +10,41 @@ import { Class } from '../classes/class.entity.js';
|
|||
import { Group } from './group.entity.js';
|
||||
import { Language } from '../content/language.js';
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* tags:
|
||||
* name: Assignment
|
||||
* description: Assignment management
|
||||
* components:
|
||||
* schemas:
|
||||
* Assignment:
|
||||
* type: object
|
||||
* properties:
|
||||
* within:
|
||||
* $ref: '#/components/schemas/Class'
|
||||
* id:
|
||||
* type: number
|
||||
* title:
|
||||
* type: string
|
||||
* description:
|
||||
* type: string
|
||||
* learningPathHruid:
|
||||
* type: string
|
||||
* learningPathLanguage:
|
||||
* $ref: '#/components/schemas/Language'
|
||||
* groups:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: '#/components/schemas/Group'
|
||||
* required:
|
||||
* - within
|
||||
* - id
|
||||
* - title
|
||||
* - description
|
||||
* - learningPathHruid
|
||||
* - learningPathLanguage
|
||||
* - groups
|
||||
*/
|
||||
@Entity()
|
||||
export class Assignment {
|
||||
@ManyToOne({
|
||||
|
|
|
@ -2,6 +2,26 @@ import { Entity, ManyToMany, ManyToOne, PrimaryKey } from '@mikro-orm/core';
|
|||
import { Assignment } from './assignment.entity.js';
|
||||
import { Student } from '../users/student.entity.js';
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* components:
|
||||
* schemas:
|
||||
* Group:
|
||||
* type: object
|
||||
* properties:
|
||||
* assignment:
|
||||
* $ref: '#/components/schemas/Assignment'
|
||||
* groupNumber:
|
||||
* type: number
|
||||
* members:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: '#/components/schemas/Student'
|
||||
* required:
|
||||
* - assignment
|
||||
* - groupNumber
|
||||
* - members
|
||||
*/
|
||||
@Entity()
|
||||
export class Group {
|
||||
@ManyToOne({
|
||||
|
|
|
@ -3,6 +3,39 @@ import { Group } from './group.entity.js';
|
|||
import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Language } from '../content/language.js';
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* components:
|
||||
* schemas:
|
||||
* Submission:
|
||||
* type: object
|
||||
* properties:
|
||||
* learningObjectHruid:
|
||||
* type: string
|
||||
* learningObjectLanguage:
|
||||
* $ref: '#/components/schemas/Language'
|
||||
* learningObjectVersion:
|
||||
* type: string
|
||||
* default: '1'
|
||||
* submissionNumber:
|
||||
* type: number
|
||||
* submitter:
|
||||
* $ref: '#/components/schemas/Student'
|
||||
* submissionTime:
|
||||
* type: string
|
||||
* format: date-time
|
||||
* onBehalfOf:
|
||||
* $ref: '#/components/schemas/Group'
|
||||
* content:
|
||||
* type: string
|
||||
* required:
|
||||
* - learningObjectHruid
|
||||
* - learningObjectLanguage
|
||||
* - submissionNumber
|
||||
* - submitter
|
||||
* - submissionTime
|
||||
* - content
|
||||
*/
|
||||
@Entity()
|
||||
export class Submission {
|
||||
@PrimaryKey({ type: 'string' })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue