claude refactor

This commit is contained in:
MineTec committed 2026-05-04 13:54:39 +02:00
1 parent 9973f12733
commit 551c1bf1fa
125 files changed
+4484 -2544

No files matched your search

@@ -0,0 +1,21 @@
import '../../../../api/webuntis/queries/getTimetable/getTimetableResponse.dart';
enum LessonStatus {
cancelled,
irregular,
teacherChanged,
past,
ongoing,
regular,
}
class LessonStatusClassifier {
static LessonStatus classify(GetTimetableResponseObject lesson, DateTime startTime, DateTime endTime, DateTime now) {
if (lesson.code == 'cancelled') return LessonStatus.cancelled;
if (lesson.code == 'irregular' || (lesson.te.isNotEmpty && lesson.te.first.id == 0)) return LessonStatus.irregular;
if (lesson.te.any((t) => t.orgname != null)) return LessonStatus.teacherChanged;
if (endTime.isBefore(now)) return LessonStatus.past;
if (startTime.isBefore(now) && endTime.isAfter(now)) return LessonStatus.ongoing;
return LessonStatus.regular;
}
}