QOL updates for profile meta
implement filterable meta for issue #158 update translations and use humanizer lib with datetime/timespan for issue #80
This commit is contained in:
@ -14,6 +14,6 @@ namespace SharedLibraryCore.Interfaces
|
||||
/// </summary>
|
||||
/// <param name="paginationInfo">pagination info</param>
|
||||
/// <returns></returns>
|
||||
Task<IList<AuditInfo>> ListAuditInformation(PaginationInfo paginationInfo);
|
||||
Task<IList<AuditInfo>> ListAuditInformation(PaginationRequest paginationInfo);
|
||||
}
|
||||
}
|
||||
|
31
SharedLibraryCore/Interfaces/IClientMeta.cs
Normal file
31
SharedLibraryCore/Interfaces/IClientMeta.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// describes all the base attributes of a client meta object
|
||||
/// </summary>
|
||||
public interface IClientMeta
|
||||
{
|
||||
MetaType Type { get; }
|
||||
DateTime When { get; }
|
||||
|
||||
bool IsSensitive { get; }
|
||||
bool ShouldDisplay { get; }
|
||||
|
||||
// sorting purposes
|
||||
public int? Column { get; set; }
|
||||
public int? Order { get; set; }
|
||||
}
|
||||
|
||||
public enum MetaType
|
||||
{
|
||||
Other,
|
||||
Information,
|
||||
AliasUpdate,
|
||||
ChatMessage,
|
||||
Penalized,
|
||||
ReceivedPenalty,
|
||||
QuickMessage
|
||||
}
|
||||
}
|
12
SharedLibraryCore/Interfaces/IClientMetaResponse.cs
Normal file
12
SharedLibraryCore/Interfaces/IClientMetaResponse.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces
|
||||
{
|
||||
public interface IClientMetaResponse
|
||||
{
|
||||
int ClientId { get;}
|
||||
int MetaId { get; }
|
||||
}
|
||||
}
|
11
SharedLibraryCore/Interfaces/IMetaRegistration.cs
Normal file
11
SharedLibraryCore/Interfaces/IMetaRegistration.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces
|
||||
{
|
||||
public interface IMetaRegistration
|
||||
{
|
||||
void Register();
|
||||
}
|
||||
}
|
51
SharedLibraryCore/Interfaces/IMetaService.cs
Normal file
51
SharedLibraryCore/Interfaces/IMetaService.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using SharedLibraryCore.Database.Models;
|
||||
using SharedLibraryCore.Dtos;
|
||||
using SharedLibraryCore.QueryHelper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces
|
||||
{
|
||||
public interface IMetaService
|
||||
{
|
||||
/// <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="client">client to save the meta for</param>
|
||||
/// <returns></returns>
|
||||
Task AddPersistentMeta(string metaKey, string metaValue, EFClient client);
|
||||
|
||||
/// <summary>
|
||||
/// retrieves meta data for given client and key
|
||||
/// </summary>
|
||||
/// <param name="metaKey">key to retrieve value for</param>
|
||||
/// <param name="client">client to retrieve meta for</param>
|
||||
/// <returns></returns>
|
||||
Task<EFMeta> GetPersistentMeta(string metaKey, EFClient client);
|
||||
|
||||
/// <summary>
|
||||
/// adds a meta task to the runtime meta list
|
||||
/// </summary>
|
||||
/// <param name="metaKey">type of meta</param>
|
||||
/// <param name="metaAction">action to perform</param>
|
||||
void AddRuntimeMeta<T,V>(MetaType metaKey, Func<T, Task<IEnumerable<V>>> metaAction) where V : IClientMeta where T: PaginationRequest;
|
||||
|
||||
/// <summary>
|
||||
/// retrieves all the runtime meta information for given client idea
|
||||
/// </summary>
|
||||
/// <param name="request">request information</param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<IClientMeta>> GetRuntimeMeta(ClientPaginationRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// retreives all the runtime of provided type
|
||||
/// </summary>
|
||||
/// <param name="request">>request information</param>
|
||||
/// <param name="metaType">type of meta to retreive</param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<T>> GetRuntimeMeta<T>(ClientPaginationRequest request, MetaType metaType) where T : IClientMeta;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user