CourseTableInfoObject typedef

CourseTableInfoObject = ({List<String> classNamesZh, List<String> classroomNamesZh, String? courseNameZh, double credits, int hours, String number, List<({DayOfWeek dayOfWeek, Period period})> schedule, List<String> teacherNamesZh})

Temporary UI contract for one course entry in the course table.

Field names and types align with current database schema as much as possible so repository implementation can migrate without API changes.

Implementation

typedef CourseTableInfoObject = ({
  /// [CourseOfferings.number].
  String number,

  /// [Courses.nameZh].
  String? courseNameZh,

  /// [Teachers.nameZh] of this offering.
  ///
  /// A course offering can have multiple teachers.
  List<String> teacherNamesZh,

  /// [Courses.credits].
  double credits,

  /// [Courses.hours].
  int hours,

  /// [Classrooms.nameZh] of this offering.
  ///
  /// A course offering can use multiple classrooms.
  List<String> classroomNamesZh,

  /// Raw schedule format from [Schedules] table.
  ///
  /// Each entry is one `(dayOfWeek, period)` slot.
  List<({DayOfWeek dayOfWeek, Period period})> schedule,

  /// [Classes.nameZh] of this offering.
  ///
  /// A course offering can target multiple classes.
  List<String> classNamesZh,
});