Slot constructor
- required int id,
- @JsonKey(name: 'startunit') required SlotTimeUnit startUnit,
- required int duration,
- required Weekday weekday,
- required String room,
- required int size,
- @JsonKey(name: 'fullness') required int reservations,
- @JsonKey(name: 'forcuruser') required bool reserved,
- @Default([]) List<
int> supervisors, - @Default([]) @JsonKey(name: 'filters') List<
CourseToSlot> mappings,
A reservable slot in the school's timetable.
Implementation
const factory Slot({
/// Unique identifier of this slot.
required int id,
/// The start time of this slot.
@JsonKey(name: 'startunit') required SlotTimeUnit startUnit,
/// The duration of this slot interpreted as [SlotTimeUnit]s.
required int duration,
/// The weekday this slot takes place on.
required Weekday weekday,
/// The room this slot takes place in.
required String room,
/// The number of students that can attend this slot.
required int size,
/// The number of students that have already reserved this slot.
@JsonKey(name: 'fullness') required int reservations,
/// `true` if the current user has reserved this slot.
@JsonKey(name: 'forcuruser') required bool reserved,
/// The user ids of those supervising this slot.
@Default([]) List<int> supervisors,
/// The course mappings of this slot.
@Default([]) @JsonKey(name: 'filters') List<CourseToSlot> mappings,
}) = _Slot;