2023-11-06 12:23:09 +01:00
|
|
|
using System;
|
2024-04-09 12:53:23 +02:00
|
|
|
using ShareeBike.Model.State;
|
|
|
|
using ShareeBike.Repository;
|
|
|
|
using ShareeBike.Repository.Response;
|
|
|
|
using ShareeBike.Repository.Response.Stations;
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2024-04-09 12:53:23 +02:00
|
|
|
namespace ShareeBike.Model.Services.CopriApi
|
2021-05-13 20:03:07 +02:00
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
public interface ICopriCache : ICopriServer
|
|
|
|
{
|
|
|
|
/// <summary> Gets a value indicating whether stations are expired or not.</summary>
|
|
|
|
bool IsStationsExpired { get; }
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Adds a stations all response to cache.</summary>
|
|
|
|
/// <param name="stations">Stations to add.</param>
|
|
|
|
void AddToCache(StationsAvailableResponse stations);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Gets a value indicating whether stations are expired or not.</summary>
|
|
|
|
bool IsBikesAvailableExpired { get; }
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Adds a bikes response to cache.</summary>
|
|
|
|
/// <param name="bikes">Bikes to add.</param>
|
2023-11-21 15:26:57 +01:00
|
|
|
/// <param name="operatorUri">Uri of the operator host to get bikes from or null if bikes have to be gotten form primary host.</param>
|
|
|
|
/// <param name="stationId"> Id of station which is used for filtering bikes. Null if no filtering should be applied.</param>
|
|
|
|
/// <param name="bikeId"> Id of bike to get.</param>
|
|
|
|
void AddToCache(BikesAvailableResponse bikes, Uri operatorUri = null, string stationId = null, string bikeId = null);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Gets a value indicating whether stations are expired or not.</summary>
|
|
|
|
bool IsBikesOccupiedExpired { get; }
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Adds a bikes response to cache.</summary>
|
|
|
|
/// <param name="bikes">Bikes to add.</param>
|
|
|
|
void AddToCache(BikesReservedOccupiedResponse bikes);
|
2024-04-09 12:53:23 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Updates cache from bike which changed rental state.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="response"></param>
|
|
|
|
void Update(BikeInfoReservedOrBooked response);
|
|
|
|
|
|
|
|
/// <summary> Updates cache from bike which changed rental state (reservation/ booking canceled). </summary>
|
|
|
|
void Update(BookingActionResponse response);
|
2022-09-06 16:08:19 +02:00
|
|
|
}
|
2021-05-13 20:03:07 +02:00
|
|
|
}
|