using System.Data.Common; using GB5Shared.DTO.Framework.Login; namespace DXPDAL.Auth; public interface IAuthDAL { Task GetUserAsync(int dxpUserId, LoginDTO login, CancellationToken ct); Task GetUserByEmailAsync(string email, LoginDTO login, CancellationToken ct); Task SaveUserAsync(UserDTO dto, LoginDTO login, DbTransaction tx, CancellationToken ct); Task UpdateLoginStatsAsync(UserDTO dto, LoginDTO login, DbTransaction tx, CancellationToken ct); Task> GetMyContextsAsync(int dxpUserId, LoginDTO login, CancellationToken ct); Task GetUserPartyRoleAsync(int dxpUserPartyRoleId, int dxpUserId, LoginDTO login, CancellationToken ct); Task SaveUserPartyRoleAsync(UserPartyRoleDTO dto, LoginDTO login, DbTransaction tx, CancellationToken ct); Task GetRefreshTokenByIdAsync(int dxpRefreshTokenId, LoginDTO login, CancellationToken ct); Task GetRefreshTokenByHashAsync(string tokenHash, LoginDTO login, CancellationToken ct); Task SaveRefreshTokenAsync(RefreshTokenDTO dto, LoginDTO login, DbTransaction tx, CancellationToken ct); Task RevokeRefreshTokenAsync(int dxpRefreshTokenId, int? replacedByTokenId, LoginDTO login, DbTransaction tx, CancellationToken ct); /// Walks the ReplacedByTokenId chain forward starting from the token AFTER /// dxpRefreshTokenId (i.e. excludes dxpRefreshTokenId itself), one PK lookup per hop — mirrors /// EntitlementDAL's IClientRefreshTokenDAL.GetChainDescendantsAsync exactly. Returns every /// descendant found, revoked or not — deciding which are "still active" and need revoking is /// a BLL-level judgment call, not a DAL concern. Task> GetChainDescendantsAsync(int dxpRefreshTokenId, LoginDTO login, CancellationToken ct); }