Core.Thalos.DAL.API/Core.Cerberos.Provider/Contracts/IRoleService.cs
Sergio Matias Urquin c34987797a Add project files.
2025-04-29 18:55:44 -06:00

73 lines
3.4 KiB
C#

// ***********************************************************************
// <copyright file="IRoleService.cs">
// Heath
// </copyright>
// ***********************************************************************
using Core.Cerberos.Adapters;
using Core.Cerberos.Adapters.Common.Enums;
using Core.Cerberos.Domain.Contexts.Onboarding.Request;
namespace Core.Cerberos.Provider.Contracts
{
public interface IRoleService
{
/// <summary>
/// Creates a new Role.
/// </summary>
/// <param name="entity">The Role to be created.</param>
/// <returns>A <see cref="{Task{RoleAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
Task<RoleAdapter> CreateRoleService(RoleRequest newRole);
/// <summary>
/// Gets an Role by identifier.
/// </summary>
/// <param name="id">The Role identifier.</param>
/// <returns>A <see cref="{Task{RoleAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
Task<RoleAdapter> GetRoleByIdService(string id);
/// <summary>
/// Gets all the roles.
/// </summary>
/// <returns>A <see cref="{Task{IEnumerbale{RoleAdapter}}}"/> representing
/// the asynchronous execution of the service.</returns>
Task<IEnumerable<RoleAdapter>> GetAllRolesService();
/// <summary>
/// Changes the status of the role.
/// </summary>
/// <param name="id">The role identifier.</param>
/// <param name="newStatus">The new status of the role.</param>
/// <returns>The <see cref="RoleAdapter"/> updated entity.</returns>
/// <returns>A <see cref="{Task{RoleAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
Task<RoleAdapter> ChangeRoleStatusService(string id, StatusEnum newStatus);
/// <summary>
/// Updates a Role by id.
/// </summary>
/// <param name="entity">The Role to be updated.</param>
/// <param name="id">The Role identifier.</param>
/// <returns>A <see cref="{Task{RoleAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
Task<RoleAdapter> UpdateRoleService(RoleAdapter entity, string id);
/// <summary>
/// Adds an application to the role's list of applications.
/// </summary>
/// <param name="roleId">The identifier of the role to which the application will be added.</param>
/// <param name="application">The application enum value to add.</param>
/// <returns>A <see cref="{Task{RoleAdapter}}"/> representing the asynchronous operation, with the updated role object.</returns>
Task<RoleAdapter> AddApplicationToRoleService(string roleId, ApplicationsEnum application);
/// <summary>
/// Removes an application from the role's list of applications.
/// </summary>
/// <param name="roleId">The identifier of the role from which the application will be removed.</param>
/// <param name="application">The application enum value to remove.</param>
/// <returns>A <see cref="{Task{RoleAdapter}}"/> representing the asynchronous operation, with the updated role object.</returns>
Task<RoleAdapter> RemoveApplicationFromRoleService(string roleId, ApplicationsEnum application);
}
}