add set client meta and inc/dec to framework

This commit is contained in:
RaidMax
2022-02-10 16:50:45 -06:00
parent aa6ae0ab8d
commit c9cf7be341
4 changed files with 277 additions and 42 deletions

View File

@ -19,6 +19,35 @@ namespace SharedLibraryCore.Interfaces
/// <returns></returns>
Task AddPersistentMeta(string metaKey, string metaValue, EFClient client, EFMeta linkedMeta = null);
/// <summary>
/// adds or updates meta key and value to the database
/// </summary>
/// <param name="metaKey">key of meta data</param>
/// <param name="metaValue">value of the meta data</param>
/// <param name="clientId">id of the client to save the meta for</param>
/// <returns></returns>
Task SetPersistentMeta(string metaKey, string metaValue, int clientId);
/// <summary>
/// increments meta value and persists to the database
/// <remarks>if the meta value does not already exist it will be set to the increment amount</remarks>
/// </summary>
/// <param name="metaKey">key of meta data</param>
/// <param name="incrementAmount">value to increment by</param>
/// <param name="clientId">id of the client to save the meta for</param>
/// <returns></returns>
Task IncrementPersistentMeta(string metaKey, int incrementAmount, int clientId);
/// <summary>
/// decrements meta value and persists to the database
/// <remarks>if the meta value does not already exist it will be set to the decrement amount</remarks>
/// </summary>
/// <param name="metaKey">key of meta data</param>
/// <param name="decrementAmount">value to increment by</param>
/// <param name="clientId">id of the client to save the meta for</param>
/// <returns></returns>
Task DecrementPersistentMeta(string metaKey, int decrementAmount, int clientId);
/// <summary>
/// adds or updates meta key and value to the database
/// </summary>
@ -82,4 +111,4 @@ namespace SharedLibraryCore.Interfaces
Task<IEnumerable<T>> GetRuntimeMeta<T>(ClientPaginationRequest request, MetaType metaType)
where T : IClientMeta;
}
}
}