feat: status teacher invite
This commit is contained in:
parent
783c91b2e3
commit
f3d2b3313c
16 changed files with 184 additions and 79 deletions
|
@ -1,15 +1,17 @@
|
|||
import { TeacherInvitation } from '../entities/classes/teacher-invitation.entity.js';
|
||||
import { mapToUserDTO } from './user.js';
|
||||
import { TeacherInvitationDTO } from '@dwengo-1/common/interfaces/teacher-invitation';
|
||||
import { getTeacherInvitationRepository } from '../data/repositories';
|
||||
import { Teacher } from '../entities/users/teacher.entity';
|
||||
import { Class } from '../entities/classes/class.entity';
|
||||
import {TeacherInvitation} from '../entities/classes/teacher-invitation.entity.js';
|
||||
import {mapToUserDTO} from './user.js';
|
||||
import {TeacherInvitationDTO} from '@dwengo-1/common/interfaces/teacher-invitation';
|
||||
import {getTeacherInvitationRepository} from '../data/repositories';
|
||||
import {Teacher} from '../entities/users/teacher.entity';
|
||||
import {Class} from '../entities/classes/class.entity';
|
||||
import {ClassStatus} from "@dwengo-1/common/util/class-join-request";
|
||||
|
||||
export function mapToTeacherInvitationDTO(invitation: TeacherInvitation): TeacherInvitationDTO {
|
||||
return {
|
||||
sender: mapToUserDTO(invitation.sender),
|
||||
receiver: mapToUserDTO(invitation.receiver),
|
||||
classId: invitation.class.classId!,
|
||||
status: invitation.status
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -18,6 +20,7 @@ export function mapToTeacherInvitationDTOIds(invitation: TeacherInvitation): Tea
|
|||
sender: invitation.sender.username,
|
||||
receiver: invitation.receiver.username,
|
||||
classId: invitation.class.classId!,
|
||||
status: invitation.status
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -26,5 +29,6 @@ export function mapToInvitation(sender: Teacher, receiver: Teacher, cls: Class):
|
|||
sender,
|
||||
receiver,
|
||||
class: cls,
|
||||
status: ClassStatus.Open,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue