Table of Contents

Interface ITenantSuperAdminRepository

Namespace
KadicAuth.Application.TenantSuperAdmins.Abstractions
Assembly
KadicAuth.Application.dll

Persistence abstraction for TenantSuperAdmin membership. Lives here (Application) so handlers can depend on it without pulling in EF Core.

public interface ITenantSuperAdminRepository

Methods

AddAsync(TenantSuperAdmin, CancellationToken)

Task AddAsync(TenantSuperAdmin entity, CancellationToken cancellationToken = default)

Parameters

entity TenantSuperAdmin
cancellationToken CancellationToken

Returns

Task

AddAuditLogAsync(TenantSuperAdminAuditLogEntry, CancellationToken)

Task AddAuditLogAsync(TenantSuperAdminAuditLogEntry entry, CancellationToken cancellationToken = default)

Parameters

entry TenantSuperAdminAuditLogEntry
cancellationToken CancellationToken

Returns

Task

CountActiveInTenantAsync(Guid, CancellationToken)

Count of currently-active tenant super admins within the given tenant. Used to prevent revoking the last active super admin.

Task<int> CountActiveInTenantAsync(Guid tenantId, CancellationToken cancellationToken = default)

Parameters

tenantId Guid
cancellationToken CancellationToken

Returns

Task<int>

GetByUserAndTenantAsync(Guid, Guid, CancellationToken)

Task<TenantSuperAdmin?> GetByUserAndTenantAsync(Guid userId, Guid tenantId, CancellationToken cancellationToken = default)

Parameters

userId Guid
tenantId Guid
cancellationToken CancellationToken

Returns

Task<TenantSuperAdmin>

IsActiveAsync(Guid, Guid, CancellationToken)

Hot-path lookup: is the given user currently an ACTIVE tenant super admin within the specified tenant? Must be a short, indexed query.

Task<bool> IsActiveAsync(Guid userId, Guid tenantId, CancellationToken cancellationToken = default)

Parameters

userId Guid
tenantId Guid
cancellationToken CancellationToken

Returns

Task<bool>

ListAsync(Guid, CancellationToken)

Task<IReadOnlyList<TenantSuperAdminDto>> ListAsync(Guid tenantId, CancellationToken cancellationToken = default)

Parameters

tenantId Guid
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<TenantSuperAdminDto>>

SaveChangesAsync(CancellationToken)

Task SaveChangesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

UpdateAsync(TenantSuperAdmin, CancellationToken)

Task UpdateAsync(TenantSuperAdmin entity, CancellationToken cancellationToken = default)

Parameters

entity TenantSuperAdmin
cancellationToken CancellationToken

Returns

Task