feat(backend): Assignment-, Group- en SubmissionRepository aangemaakt

This commit is contained in:
Gerald Schmittinger 2025-02-26 00:00:18 +01:00
parent bd93e5fae3
commit 2837618fd5
8 changed files with 75 additions and 4 deletions

View file

@ -0,0 +1,15 @@
import {DwengoEntityRepository} from "../dwengo-entity-repository";
import {Assignment} from "../../entities/assignments/assignment.entity";
import {Class} from "../../entities/classes/class.entity";
export class AssignmentRepository extends DwengoEntityRepository<Assignment> {
public findByClassAndId(within: Class, id: number): Promise<Assignment | null> {
return this.findOne({within: within, id: id});
}
public findAllAssignmentsInClass(within: Class): Promise<Assignment[]> {
return this.findAll({where: {within: within}});
}
public deleteByClassAndId(within: Class, id: number): Promise<void> {
return this.deleteWhere({within: within, id: id});
}
}