StdSlotsDatasource class
Standard implementation of SlotsDatasource.
- Inheritance
-
- Object
- ILoggable
- Datasource
- SlotsDatasource
- StdSlotsDatasource
Constructors
- StdSlotsDatasource(ApiService api)
- Standard implementation of SlotsDatasource.
Properties
- api → ApiService
-
The API service to use.
final
- 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 setterinherited
- 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.override -
addSupervisor(
{required String token, required int slotId, required int supervisorId}) → Future< void> -
Adds
supervisorId
to the supervisors of the slot withslotId
.override -
cancelReservation(
{required String token, required int reservationId, bool force = false}) → Future< void> -
Cancels the reservation with
reservationId
.override -
createSlot(
{required String token, required Slot slot}) → Future< Slot> -
Pushes a new
slot
to the server.override -
deleteSlot(
{required String token, required int slotId}) → Future< void> -
Deletes the slot with
slotId
.override -
deleteSlotMapping(
{required String token, required int mappingId}) → Future< void> -
Deletes the mapping with
mappingId
.override -
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
.override -
getSlotReservations(
{required String token, required int slotId}) → Future< List< Reservation> > -
Fetches all reservations for the slot with
slotId
.override -
getSlots(
String token) → Future< List< Slot> > -
Fetches the slots the current user can theoretically reserve.
override
-
getStudentSlots(
{required String token, required int studentId}) → Future< List< Slot> > -
Fetches all slots a supervisor can theoretically reserve for a student.
override
-
getSupervisedSlots(
String tokrn) → Future< List< Slot> > -
Fetches all slots supervised by the current user.
override
-
getUserReservations(
String token) → Future< List< Reservation> > -
Fetches all reservations made by the current user.
override
-
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
ondate
.override -
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.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited