/// A concrete, selectable timetable element: its type, WebUntis element id and
/// a human-readable label (room short name, abbreviated student name, …). Used
/// to hand a picker selection back to the timetable view and to drive the
/// inline foreign-plan rendering.
typedef TimetableElementRef = ({TimetableElementType type, int id, String label});

/// The four kinds of timetable elements whose schedule can be requested via
/// `timetable/{type}/{id}`. `schoolClass` is named to avoid the reserved Dart
/// keyword `class`; its [pathSegment] maps back to the backend's `class`.
enum TimetableElementType {
  student,
  teacher,
  room,
  schoolClass;

  /// Path segment used in the backend timetable endpoint URL.
  String get pathSegment {
    switch (this) {
      case TimetableElementType.student:
        return 'student';
      case TimetableElementType.teacher:
        return 'teacher';
      case TimetableElementType.room:
        return 'room';
      case TimetableElementType.schoolClass:
        return 'class';
    }
  }

  /// Singular German label for the UI (picker segments, hints).
  String get label {
    switch (this) {
      case TimetableElementType.student:
        return 'Schüler';
      case TimetableElementType.teacher:
        return 'Lehrer';
      case TimetableElementType.room:
        return 'Raum';
      case TimetableElementType.schoolClass:
        return 'Klasse';
    }
  }
}
