SlotsDatasource class abstract

Datasource mapping the slots endpoints.

Inheritance
Implementers

Constructors

SlotsDatasource()

Properties

errorLevel Level
The level to log error messages at.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
level Level
The level to log messages at.
no setterinherited
name String
The name of the datasource.
no setteroverride
namespace String
The namespace to log messages under. e.g. 'Service.Auth'
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addSlotMapping({required String token, required CourseToSlot mapping}) Future<CourseToSlot>
Pushes a new mapping to the server.
addSupervisor({required String token, required int slotId, required int supervisorId}) Future<void>
Adds supervisorId to the supervisors of the slot with slotId.
cancelReservation({required String token, required int reservationId, bool force = false}) Future<void>
Cancels the reservation with reservationId.
createSlot({required String token, required Slot slot}) Future<Slot>
Pushes a new slot to the server.
deleteSlot({required String token, required int slotId}) Future<void>
Deletes the slot with slotId.
deleteSlotMapping({required String token, required int mappingId}) Future<void>
Deletes the mapping with mappingId.
dispose() → void
Disposes controllers, streams, etc.
inherited
getSlotMappings({required String token, required int slotId}) Future<List<CourseToSlot>>
Fetches all mappings for the slot with slotId.
getSlotReservations({required String token, required int slotId}) Future<List<Reservation>>
Fetches all reservations for the slot with slotId.
getSlots(String token) Future<List<Slot>>
Fetches the slots the current user can theoretically reserve.
getStudentSlots({required String token, required int studentId}) Future<List<Slot>>
Fetches all slots a supervisor can theoretically reserve for a student.
getSupervisedSlots(String tokrn) Future<List<Slot>>
Fetches all slots supervised by the current user.
getUserReservations(String token) Future<List<Reservation>>
Fetches all reservations made by the current user.
log(Object message, [Object? error, StackTrace? stackTrace]) → void
Logs a message with an optional error and stack trace.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reserveSlot({required String token, required int slotId, required DateTime date, int? studentId}) Future<Reservation>
Reserves the slot with slotId on date.
toString() String
A string representation of this object.
inherited
updateSlot({required String token, required Slot slot}) Future<void>
Pushes an updated slot to the server.

Operators

operator ==(Object other) bool
The equality operator.
inherited