feat(data-interface): add date filter to getAvailabilityForUser

By providing a start and end date for getAvailabilityForUser you can get a subset of all availability.
This commit is contained in:
Freek van de Ven 2024-07-03 09:58:12 +02:00
parent 178db2d753
commit d456ffb5ba

View file

@ -10,8 +10,12 @@ abstract interface class AvailabilityDataInterface {
/// Retrieves a list of availabilities for the given [userId]. /// Retrieves a list of availabilities for the given [userId].
/// ///
/// Whether this is a one time value or a continuous stream of values is up to /// Whether this is a one time value or a continuous stream of values is up to
/// the implementation. /// the implementation. The [start] and [end] parameters can be used to filter
Stream<List<AvailabilityModel>> getAvailabilityForUser(String userId); Stream<List<AvailabilityModel>> getAvailabilityForUser({
required String userId,
DateTime? start,
DateTime? end,
});
/// Retrieves a specific availability for the given /// Retrieves a specific availability for the given
/// [userId] and [availabilityId] /// [userId] and [availabilityId]