-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcourse.dart
More file actions
90 lines (76 loc) · 2.14 KB
/
course.dart
File metadata and controls
90 lines (76 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// dart format off
/// Day of the week for class schedules.
enum DayOfWeek {
// TODO: turn weekday label to i18n string
sunday('日'),
monday('一'),
tuesday('二'),
wednesday('三'),
thursday('四'),
friday('五'),
saturday('六');
final String label;
const DayOfWeek(this.label);
}
/// Class period within a day, following NTUT's schedule structure.
///
/// NTUT uses periods 1-4, N (noon), 5-9, and A-D:
/// - 1-4: Morning periods
/// - N: Noon period
/// - 5-9: Afternoon periods
/// - A-D: Evening periods
enum Period {
first('1'),
second('2'),
third('3'),
fourth('4'),
nPeriod('N'),
fifth('5'),
sixth('6'),
seventh('7'),
eighth('8'),
ninth('9'),
aPeriod('A'),
bPeriod('B'),
cPeriod('C'),
dPeriod('D');
final String code;
const Period(this.code);
}
/// Course type for graduation credit requirements (課程標準).
///
/// Symbols indicate both the credit category and whether it's required/elective:
/// - Shape: ○● (Dept), △▲ (University), ☆★ (Elective)
/// - Fill: Empty (Common), Filled (Major)
enum CourseType {
/// ○ Dept. Common Required Credits (系共同必修).
deptCommonRequired('○'),
/// △ University Common Required Credits (校共同必修).
universityCommonRequired('△'),
/// ☆ Common Elective Credits (共同選修).
commonElective('☆'),
/// ● Dept. Major Required Credits (系專業必修).
deptMajorRequired('●'),
/// ▲ University Major Required Credits (校專業必修).
universityMajorRequired('▲'),
/// ★ Major Elective Credits (專業選修).
majorElective('★');
/// The symbol used on the syllabus page (修 column).
final String symbol;
const CourseType(this.symbol);
}
// dart format on
/// Reference to an entity (course, teacher, classroom, etc.) with an ID and name.
typedef ReferenceDto = ({
/// Entity's unique identifier code.
String? id,
/// Entity's display name.
String? name,
});
/// Academic semester identifier.
typedef SemesterDto = ({
/// Academic year in ROC calendar (e.g., 114 for 2025).
int? year,
/// Term number (0 for pre-study, 1 for fall, 2 for spring, 3 for summer).
int? term,
});