Merge remote-tracking branch 'origin/refactor/common' into feat/user-routes
# Conflicts: # backend/src/controllers/students.ts # backend/src/controllers/teachers.ts # backend/src/interfaces/question.ts # backend/src/services/classes.ts # backend/src/services/students.ts # backend/src/services/teachers.ts
This commit is contained in:
		
						commit
						7d8a0fcbb2
					
				
					 96 changed files with 205 additions and 153 deletions
				
			
		|  | @ -1,7 +1,7 @@ | |||
| import { mapToUserDTO } from './user.js'; | ||||
| import { mapToQuestionDTO, mapToQuestionDTOId } from './question.js'; | ||||
| import { Answer } from '../entities/questions/answer.entity.js'; | ||||
| import { AnswerDTO, AnswerId } from 'dwengo-1-common/src/interfaces/answer'; | ||||
| import { AnswerDTO, AnswerId } from '@dwengo-1/common/interfaces/answer'; | ||||
| 
 | ||||
| /** | ||||
|  * Convert a Question entity to a DTO format. | ||||
|  |  | |||
|  | @ -1,9 +1,9 @@ | |||
| import { languageMap } from '@dwengo-1/common/util/language'; | ||||
| import { FALLBACK_LANG } from '../config.js'; | ||||
| import { Assignment } from '../entities/assignments/assignment.entity.js'; | ||||
| import { Class } from '../entities/classes/class.entity.js'; | ||||
| import { getLogger } from '../logging/initalize.js'; | ||||
| import { languageMap } from '../entities/content/language.js'; | ||||
| import { AssignmentDTO } from 'dwengo-1-common/src/interfaces/assignment'; | ||||
| import { AssignmentDTO } from '@dwengo-1/common/interfaces/assignment'; | ||||
| 
 | ||||
| export function mapToAssignmentDTOId(assignment: Assignment): AssignmentDTO { | ||||
|     return { | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ import { Collection } from '@mikro-orm/core'; | |||
| import { Class } from '../entities/classes/class.entity.js'; | ||||
| import { Student } from '../entities/users/student.entity.js'; | ||||
| import { Teacher } from '../entities/users/teacher.entity.js'; | ||||
| import { ClassDTO } from 'dwengo-1-common/src/interfaces/class'; | ||||
| import { ClassDTO } from '@dwengo-1/common/interfaces/class'; | ||||
| 
 | ||||
| export function mapToClassDTO(cls: Class): ClassDTO { | ||||
|     return { | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| import { Group } from '../entities/assignments/group.entity.js'; | ||||
| import { mapToAssignmentDTO } from './assignment.js'; | ||||
| import { mapToStudentDTO } from './student.js'; | ||||
| import { GroupDTO } from 'dwengo-1-common/src/interfaces/group'; | ||||
| import { GroupDTO } from '@dwengo-1/common/interfaces/group'; | ||||
| 
 | ||||
| export function mapToGroupDTO(group: Group): GroupDTO { | ||||
|     return { | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| import { Question } from '../entities/questions/question.entity.js'; | ||||
| import { mapToStudentDTO } from './student.js'; | ||||
| import { QuestionDTO, QuestionId } from 'dwengo-1-common/src/interfaces/question'; | ||||
| import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier'; | ||||
| import { QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question'; | ||||
| 
 | ||||
| function getLearningObjectIdentifier(question: Question): LearningObjectIdentifier { | ||||
|     return { | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import { Student } from '../entities/users/student.entity.js'; | ||||
| import { getStudentRepository } from '../data/repositories.js'; | ||||
| import { StudentDTO } from 'dwengo-1-common/src/interfaces/student'; | ||||
| import { StudentDTO } from '@dwengo-1/common/interfaces/student'; | ||||
| 
 | ||||
| export function mapToStudentDTO(student: Student): StudentDTO { | ||||
|     return { | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| import { Submission } from '../entities/assignments/submission.entity.js'; | ||||
| import { mapToGroupDTO } from './group.js'; | ||||
| import { mapToStudent, mapToStudentDTO } from './student.js'; | ||||
| import { SubmissionDTO, SubmissionDTOId } from 'dwengo-1-common/src/interfaces/submission'; | ||||
| import { SubmissionDTO, SubmissionDTOId } from '@dwengo-1/common/interfaces/submission'; | ||||
| 
 | ||||
| export function mapToSubmissionDTO(submission: Submission): SubmissionDTO { | ||||
|     return { | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| import { TeacherInvitation } from '../entities/classes/teacher-invitation.entity.js'; | ||||
| import { mapToClassDTO } from './class.js'; | ||||
| import { mapToUserDTO } from './user.js'; | ||||
| import { TeacherInvitationDTO } from 'dwengo-1-common/src/interfaces/teacher-invitation'; | ||||
| import { TeacherInvitationDTO } from '@dwengo-1/common/interfaces/teacher-invitation'; | ||||
| 
 | ||||
| export function mapToTeacherInvitationDTO(invitation: TeacherInvitation): TeacherInvitationDTO { | ||||
|     return { | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import { Teacher } from '../entities/users/teacher.entity.js'; | ||||
| import { getTeacherRepository } from '../data/repositories.js'; | ||||
| import { TeacherDTO } from 'dwengo-1-common/src/interfaces/teacher'; | ||||
| import { TeacherDTO } from '@dwengo-1/common/interfaces/teacher'; | ||||
| 
 | ||||
| export function mapToTeacherDTO(teacher: Teacher): TeacherDTO { | ||||
|     return { | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| import { User } from '../entities/users/user.entity.js'; | ||||
| import { UserDTO } from 'dwengo-1-common/src/interfaces/user'; | ||||
| import { UserDTO } from '@dwengo-1/common/interfaces/user'; | ||||
| 
 | ||||
| export function mapToUserDTO(user: User): UserDTO { | ||||
|     return { | ||||
|  |  | |||
		Reference in a new issue
	
	 Gabriellvl
						Gabriellvl