130 lines
5.9 KiB
C#
130 lines
5.9 KiB
C#
// ***********************************************************************
|
|
// <copyright file="IUserService.cs">
|
|
// AgileWebs
|
|
// </copyright>
|
|
// ***********************************************************************
|
|
using Core.Blueprint.Storage.Adapters;
|
|
using Core.Thalos.Adapters;
|
|
using Core.Thalos.Adapters.Common.Enums;
|
|
using Core.Thalos.Domain.Contexts.Onboarding.Request;
|
|
|
|
namespace Core.Thalos.Provider.Contracts
|
|
{
|
|
public interface IUserService
|
|
{
|
|
/// <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>
|
|
Task<UserAdapter> CreateUserService(UserRequest newUser);
|
|
|
|
/// <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>
|
|
Task<UserAdapter> GetUserByIdService(string id);
|
|
|
|
|
|
/// <summary>
|
|
/// Gets all the users.
|
|
/// </summary>
|
|
/// <returns>A <see cref="{Task{IEnumerable{UserAdapter}}}"/> representing
|
|
/// the asynchronous execution of the service.</returns>
|
|
Task<IEnumerable<UserAdapter>> GetAllUsersService();
|
|
|
|
/// <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>
|
|
Task<UserAdapter> GetUserByEmailService(string? email);
|
|
|
|
/// <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>
|
|
Task<UserAdapter> ValidateUserExistenceService(string? email);
|
|
|
|
/// <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>
|
|
Task<UserAdapter> ChangeUserStatusService(string id, StatusEnum newStatus);
|
|
|
|
/// <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>
|
|
Task<UserAdapter> UpdateUserService(UserAdapter entity, string id);
|
|
|
|
/// <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>
|
|
Task<UserAdapter?> LogInUserService(string email);
|
|
|
|
/// <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>
|
|
Task<UserAdapter> LogOutUserSessionService(string email);
|
|
|
|
/// <summary>
|
|
/// Adds a company to the user's list of companies.
|
|
/// </summary>
|
|
/// <param name="userId">The identifier of the user to whom the company will be added.</param>
|
|
/// <param name="companyId">The identifier of the company to add.</param>
|
|
/// <returns>A <see cref="Task{UserAdapter}"/> representing the asynchronous operation, with the updated user object.</returns>
|
|
Task<UserAdapter> AddCompanyToUserService(string userId, string companyId);
|
|
|
|
/// <summary>
|
|
/// Removes a company from the user's list of companies.
|
|
/// </summary>
|
|
/// <param name="userId">The identifier of the user from whom the company will be removed.</param>
|
|
/// <param name="companyId">The identifier of the company to remove.</param>
|
|
/// <returns>A <see cref="Task{UserAdapter}"/> representing the asynchronous operation, with the updated user object.</returns>
|
|
Task<UserAdapter> RemoveCompanyFromUserService(string userId, string companyId);
|
|
|
|
/// <summary>
|
|
/// Adds a project to the user's list of projects.
|
|
/// </summary>
|
|
/// <param name="userId">The identifier of the user to whom the project will be added.</param>
|
|
/// <param name="projectId">The identifier of the project to add.</param>
|
|
/// <returns>A <see cref="Task{UserAdapter}"/> representing the asynchronous operation, with the updated user object.</returns>
|
|
Task<UserAdapter> AddProjectToUserService(string userId, string projectId);
|
|
|
|
|
|
/// <summary>
|
|
/// Removes a project from the user's list of projects.
|
|
/// </summary>
|
|
/// <param name="userId">The identifier of the user from whom the project will be removed.</param>
|
|
/// <param name="projectId">The identifier of the project to remove.</param>
|
|
/// <returns>A <see cref="Task{UserAdapter}"/> representing the asynchronous operation, with the updated user object.</returns>
|
|
Task<UserAdapter> RemoveProjectFromUserService(string userId, string projectId);
|
|
|
|
/// <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>
|
|
Task<TokenAdapter?> GetTokenAdapter(string email);
|
|
}
|
|
}
|