feat: add upcoming colles

This commit is contained in:
Nathan Lamy 2026-02-25 00:36:19 +01:00
parent cc817cf9a7
commit f8d698685f

View file

@ -106,6 +106,18 @@ export class ColleService {
const studentColles = await studentCollesQuery
const now = DateTime.now()
const upcomingClassColles = await Colle.query()
.whereHas('student', (query) => {
query.where('className', student.className)
})
.where('date', '>=', now.toISODate()!)
.orderBy('date', 'asc')
.preload('student')
.preload('examiner')
.preload('subject')
.preload('room')
// TODO: Favorite colles
const favoriteColles = [] as Colle[]
@ -113,6 +125,7 @@ export class ColleService {
classColles,
studentColles,
favoriteColles,
upcomingClassColles,
healthyUntil: await this.getHealthyUntil(student.className),
lastSync: await this.getLastSync(student.className),
}