// *********************************************************************** // // AgileWebs // // *********************************************************************** using Core.Blueprint.Mongo; using Core.Thalos.Adapters; using Core.Thalos.Domain.Contexts.Onboarding.Request; namespace Core.Thalos.Provider.Contracts { public interface IUserProvider { /// /// Creates a new User. /// /// The User to be created. /// A representing /// the asynchronous execution of the service. ValueTask CreateUser(UserRequest newUser, CancellationToken cancellationToken); /// /// Gets an User by identifier. /// /// The User identifier. /// A representing /// the asynchronous execution of the service. ValueTask GetUserById(string _id, CancellationToken cancellationToken); /// /// Gets all the users. /// /// A representing /// the asynchronous execution of the service. ValueTask> GetAllUsers(CancellationToken cancellationToken); /// /// Gets an User by email. /// /// The User email. /// A representing /// the asynchronous execution of the service. ValueTask GetUserByEmail(string? email, CancellationToken cancellationToken); /// /// Validates if a users exists by email. /// /// The User email. /// A representing /// the asynchronous execution of the service. ValueTask ValidateUserExistence(string? email, CancellationToken cancellationToken); /// /// Changes the status of the user. /// /// The user identifier. /// The new status of the user. /// A representing /// the asynchronous execution of the service. ValueTask ChangeUserStatus(string id, StatusEnum newStatus, CancellationToken cancellationToken); /// /// Updates a User by id. /// /// The User to be updated. /// The User identifier. /// A representing /// the asynchronous execution of the service. ValueTask UpdateUser(UserAdapter entity, CancellationToken cancellationToken); /// /// Logs in the user. /// /// The User's email. /// A representing /// the asynchronous execution of the service. ValueTask LogInUser(string email, CancellationToken cancellationToken); /// /// Logs out the user's session. /// /// The User's email. /// A representing /// the asynchronous execution of the service. ValueTask LogOutUserSession(string email, CancellationToken cancellationToken); /// /// Adds a company to the user's list of companies. /// /// The identifier of the user to whom the company will be added. /// The identifier of the company to add. /// A representing the asynchronous operation, with the updated user object. ValueTask AddCompanyToUser(string userId, string companyId, CancellationToken cancellationToken); /// /// Removes a company from the user's list of companies. /// /// The identifier of the user from whom the company will be removed. /// The identifier of the company to remove. /// A representing the asynchronous operation, with the updated user object. ValueTask RemoveCompanyFromUser(string userId, string companyId, CancellationToken cancellationToken); /// /// Adds a project to the user's list of projects. /// /// The identifier of the user to whom the project will be added. /// The identifier of the project to add. /// A representing the asynchronous operation, with the updated user object. ValueTask AddProjectToUser(string userId, string projectId, CancellationToken cancellationToken); /// /// Removes a project from the user's list of projects. /// /// The identifier of the user from whom the project will be removed. /// The identifier of the project to remove. /// A representing the asynchronous operation, with the updated user object. ValueTask RemoveProjectFromUser(string userId, string projectId, CancellationToken cancellationToken); /// /// Gets the token adapter for a user. /// /// The user's email. /// A representing the asynchronous execution of the service. ValueTask GetToken(string email, CancellationToken cancellationToken); /// /// Delete an User by identifier. /// /// The User identifier. /// A representing /// the asynchronous execution of the service. ValueTask DeleteUser(string _id, CancellationToken cancellationToken); } }