Submission entity added to database
This commit is contained in:
		
							parent
							
								
									8a0a89fe45
								
							
						
					
					
						commit
						28ac99b2b5
					
				
					 1 changed files with 22 additions and 0 deletions
				
			
		
							
								
								
									
										22
									
								
								backend/src/entities/assigments/submission.entity.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								backend/src/entities/assigments/submission.entity.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | ||||||
|  | import {Student} from "../users/student.entity"; | ||||||
|  | import {Group} from "./group.entity"; | ||||||
|  | import {Entity, Enum, ManyToOne, PrimaryKey} from "@mikro-orm/core"; | ||||||
|  | import {Language} from "../content/language"; | ||||||
|  | 
 | ||||||
|  | @Entity() | ||||||
|  | export class Submission { | ||||||
|  |     @ManyToOne({entity: () => Student, primary: true}) | ||||||
|  |     submitter!: Student; | ||||||
|  | 
 | ||||||
|  |     @ManyToOne({entity: () => Group, primary: true}) | ||||||
|  |     onBehalfOf!: Group; | ||||||
|  | 
 | ||||||
|  |     @PrimaryKey({type: "string"}) | ||||||
|  |     hruid!: string; | ||||||
|  | 
 | ||||||
|  |     @Enum({items: () => Language, primary: true}) | ||||||
|  |     language!: Language; | ||||||
|  | 
 | ||||||
|  |     @PrimaryKey({type: "string"}) | ||||||
|  |     version: number = "1"; | ||||||
|  | } | ||||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger