103 lines
4.6 KiB
C#
103 lines
4.6 KiB
C#
// ***********************************************************************
|
|
// <copyright file="IUserService.cs">
|
|
// AgileWebs
|
|
// </copyright>
|
|
// ***********************************************************************
|
|
using Core.Thalos.BuildingBlocks;
|
|
using Core.Thalos.Domain.Contexts.Onboarding.Request;
|
|
|
|
namespace Core.Thalos.Provider.Contracts
|
|
{
|
|
public interface IUserProvider
|
|
{
|
|
/// <summary>
|
|
/// Creates a new User.
|
|
/// </summary>
|
|
/// <param name="entity">The User to be created.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserAdapter> CreateUser(UserRequest newUser, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets an User by identifier.
|
|
/// </summary>
|
|
/// <param name="id">The User identifier.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserAdapter> GetUserById(string _id, CancellationToken cancellationToken);
|
|
|
|
|
|
/// <summary>
|
|
/// Gets all the users.
|
|
/// </summary>
|
|
/// <returns>A <see cref="{Task{IEnumerable{UserAdapter}}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<IEnumerable<UserAdapter>> GetAllUsers(CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets an User by email.
|
|
/// </summary>
|
|
/// <param name="email">The User email.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserAdapter> GetUserByEmail(string? email, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Validates if a users exists by email.
|
|
/// </summary>
|
|
/// <param name="eamil">The User email.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserExistenceAdapter> ValidateUserExistence(string? email, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Changes the status of the user.
|
|
/// </summary>
|
|
/// <param name="id">The user identifier.</param>
|
|
/// <param name="newStatus">The new status of the user.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserAdapter> ChangeUserStatus(string id, Blueprint.Mongo.StatusEnum newStatus, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Updates a User by id.
|
|
/// </summary>
|
|
/// <param name="entity">The User to be updated.</param>
|
|
/// <param name="id">The User identifier.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserAdapter> UpdateUser(UserAdapter entity, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Logs in the user.
|
|
/// </summary>
|
|
/// <param name="email">The User's email.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserAdapter?> LogInUser(string email, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Logs out the user's session.
|
|
/// </summary>
|
|
/// <param name="email">The User's email.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserAdapter?> LogOutUserSession(string email, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets the token adapter for a user.
|
|
/// </summary>
|
|
/// <param name="email">The user's email.</param>
|
|
/// <returns>A <see cref="{Task{TokenAdapter}}"/> representing the asynchronous execution of the service.</returns>
|
|
ValueTask<TokenAdapter?> GetToken(string email, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Delete an User by identifier.
|
|
/// </summary>
|
|
/// <param name="id">The User identifier.</param>
|
|
/// <returns>A <see cref="{Task{UserAdapter}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
ValueTask<UserAdapter> DeleteUser(string _id, CancellationToken cancellationToken);
|
|
}
|
|
}
|