using e_suite.Database.Audit;
using e_suite.Database.Core;
using e_suite.Database.Core.Tables.Domain;
using e_suite.Database.Core.Tables.UserManager;
using eSuite.Core.Miscellaneous;

namespace e_suite.API.Common.repository;

public interface IRoleManagerRepository : IRepository
{
    IQueryable<Role> GetRolesList();
    Role? GetRoleById(IGeneralIdRef generalIdRef);
    Task<Role?> GetRoleByIdAsync(IGeneralIdRef generalIdRef, CancellationToken cancellationToken);
    Task<Role?> GetRoleByName(Domain domain, string sequenceName, CancellationToken cancellationToken);
    Task EditRole(AuditUserDetails auditUserDetails, Role existingSequence, CancellationToken cancellationToken);
    Task AddRole(AuditUserDetails auditUserDetails, Role existingSequence, CancellationToken cancellationToken);
    IQueryable<UserRole> GetUserRoles();
    Task AddUserRole(AuditUserDetails auditUserDetails, Role existingRole, User existingUser, CancellationToken cancellationToken);
    Task DeleteUserRole(AuditUserDetails auditUserDetails, Role existingRole, User existingUser, CancellationToken cancellationToken);
    IQueryable<RoleAccess> GetAccessForRole();
    Task AddSecurityAccess(AuditUserDetails auditUserDetails, List<RoleAccess> rollAccessToAdd, CancellationToken cancellationToken);
    Task DeleteSecurityAccess(AuditUserDetails auditUserDetails, List<RoleAccess> rollAccessToAdd, CancellationToken cancellationToken);
    IQueryable<UserAccess> GetUserAccess();
}