refactor: 管理端去租户过滤并Portal化RBAC菜单
This commit is contained in:
@@ -17,19 +17,23 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<Store?> FindByIdAsync(long storeId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public Task<Store?> FindByIdAsync(long storeId, long? tenantId, CancellationToken cancellationToken = default, bool includeDeleted = false)
|
||||
{
|
||||
var query = context.Stores.AsNoTracking();
|
||||
if (tenantId <= 0)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 返回门店实体
|
||||
return query
|
||||
.Where(x => x.Id == storeId)
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
@@ -47,58 +51,68 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<Store>> SearchAsync(
|
||||
long tenantId,
|
||||
long? tenantId,
|
||||
long? merchantId,
|
||||
StoreStatus? status,
|
||||
StoreAuditStatus? auditStatus,
|
||||
StoreBusinessStatus? businessStatus,
|
||||
StoreOwnershipType? ownershipType,
|
||||
string? keyword,
|
||||
bool ignoreTenantFilter = false,
|
||||
bool includeDeleted = false,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
var query = context.Stores.AsNoTracking();
|
||||
if (ignoreTenantFilter)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 可选过滤:商户
|
||||
if (merchantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.MerchantId == merchantId.Value);
|
||||
}
|
||||
|
||||
// 4. (空行后) 可选过滤:状态
|
||||
if (status.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.Status == status.Value);
|
||||
}
|
||||
|
||||
// 5. (空行后) 可选过滤:审核状态
|
||||
if (auditStatus.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.AuditStatus == auditStatus.Value);
|
||||
}
|
||||
|
||||
// 6. (空行后) 可选过滤:经营状态
|
||||
if (businessStatus.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.BusinessStatus == businessStatus.Value);
|
||||
}
|
||||
|
||||
// 7. (空行后) 可选过滤:主体类型
|
||||
if (ownershipType.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.OwnershipType == ownershipType.Value);
|
||||
}
|
||||
|
||||
// 8. (空行后) 可选过滤:关键词
|
||||
if (!string.IsNullOrWhiteSpace(keyword))
|
||||
{
|
||||
var trimmed = keyword.Trim();
|
||||
query = query.Where(x => x.Name.Contains(trimmed) || x.Code.Contains(trimmed));
|
||||
}
|
||||
|
||||
// 9. (空行后) 查询并返回结果
|
||||
var stores = await query
|
||||
.OrderBy(x => x.Name)
|
||||
.ToListAsync(cancellationToken);
|
||||
@@ -152,15 +166,14 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
var query = context.Stores.AsNoTracking();
|
||||
if (!tenantId.HasValue || tenantId.Value <= 0)
|
||||
{
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
else
|
||||
|
||||
// 1. 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 2. (空行后) 分组统计门店数量
|
||||
return await query
|
||||
.Where(x => merchantIds.Contains(x.MerchantId))
|
||||
.GroupBy(x => x.MerchantId)
|
||||
@@ -169,19 +182,23 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<StoreBusinessHour>> GetBusinessHoursAsync(long storeId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<StoreBusinessHour>> GetBusinessHoursAsync(long storeId, long? tenantId, CancellationToken cancellationToken = default, bool includeDeleted = false)
|
||||
{
|
||||
var query = context.StoreBusinessHours.AsNoTracking();
|
||||
if (tenantId <= 0)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 查询并返回营业时段
|
||||
var hours = await query
|
||||
.Where(x => x.StoreId == storeId)
|
||||
.OrderBy(x => x.DayOfWeek)
|
||||
@@ -192,19 +209,23 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<StoreFee?> GetStoreFeeAsync(long storeId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public Task<StoreFee?> GetStoreFeeAsync(long storeId, long? tenantId, CancellationToken cancellationToken = default, bool includeDeleted = false)
|
||||
{
|
||||
var query = context.StoreFees.AsNoTracking();
|
||||
if (tenantId <= 0)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 返回费用配置
|
||||
return query
|
||||
.Where(x => x.StoreId == storeId)
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
@@ -224,19 +245,23 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<StoreQualification>> GetQualificationsAsync(long storeId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<StoreQualification>> GetQualificationsAsync(long storeId, long? tenantId, CancellationToken cancellationToken = default, bool includeDeleted = false)
|
||||
{
|
||||
var query = context.StoreQualifications.AsNoTracking();
|
||||
if (tenantId <= 0)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 查询并返回资质列表
|
||||
var qualifications = await query
|
||||
.Where(x => x.StoreId == storeId)
|
||||
.OrderBy(x => x.SortOrder)
|
||||
@@ -305,19 +330,23 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<StoreDeliveryZone>> GetDeliveryZonesAsync(long storeId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<StoreDeliveryZone>> GetDeliveryZonesAsync(long storeId, long? tenantId, CancellationToken cancellationToken = default, bool includeDeleted = false)
|
||||
{
|
||||
var query = context.StoreDeliveryZones.AsNoTracking();
|
||||
if (tenantId <= 0)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 查询并返回配送区域
|
||||
var zones = await query
|
||||
.Where(x => x.StoreId == storeId)
|
||||
.OrderBy(x => x.SortOrder)
|
||||
@@ -327,38 +356,46 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<StoreDeliveryZone?> FindDeliveryZoneByIdAsync(long deliveryZoneId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public Task<StoreDeliveryZone?> FindDeliveryZoneByIdAsync(long deliveryZoneId, long? tenantId, CancellationToken cancellationToken = default, bool includeDeleted = false)
|
||||
{
|
||||
var query = context.StoreDeliveryZones.AsQueryable();
|
||||
if (tenantId <= 0)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 返回配送区域实体
|
||||
return query
|
||||
.Where(x => x.Id == deliveryZoneId)
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<StoreHoliday>> GetHolidaysAsync(long storeId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<StoreHoliday>> GetHolidaysAsync(long storeId, long? tenantId, CancellationToken cancellationToken = default, bool includeDeleted = false)
|
||||
{
|
||||
var query = context.StoreHolidays.AsNoTracking();
|
||||
if (tenantId <= 0)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 查询并返回节假日
|
||||
var holidays = await query
|
||||
.Where(x => x.StoreId == storeId)
|
||||
.OrderBy(x => x.Date)
|
||||
@@ -368,19 +405,23 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<StoreHoliday?> FindHolidayByIdAsync(long holidayId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public Task<StoreHoliday?> FindHolidayByIdAsync(long holidayId, long? tenantId, CancellationToken cancellationToken = default, bool includeDeleted = false)
|
||||
{
|
||||
var query = context.StoreHolidays.AsQueryable();
|
||||
if (tenantId <= 0)
|
||||
|
||||
// 1. 包含软删除数据时忽略全局过滤
|
||||
if (includeDeleted)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
|
||||
// 2. (空行后) 可选租户过滤
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 3. (空行后) 返回节假日实体
|
||||
return query
|
||||
.Where(x => x.Id == holidayId)
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
@@ -624,19 +665,16 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DeleteDeliveryZoneAsync(long deliveryZoneId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public async Task DeleteDeliveryZoneAsync(long deliveryZoneId, long? tenantId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// 1. 查询目标配送区域
|
||||
var query = context.StoreDeliveryZones.AsQueryable();
|
||||
if (tenantId <= 0)
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 2. (空行后) 执行软删除
|
||||
var existing = await query
|
||||
.Where(x => x.Id == deliveryZoneId)
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
@@ -648,19 +686,16 @@ public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRep
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DeleteHolidayAsync(long holidayId, long tenantId, CancellationToken cancellationToken = default)
|
||||
public async Task DeleteHolidayAsync(long holidayId, long? tenantId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// 1. 查询目标节假日
|
||||
var query = context.StoreHolidays.AsQueryable();
|
||||
if (tenantId <= 0)
|
||||
if (tenantId.HasValue)
|
||||
{
|
||||
query = query.IgnoreQueryFilters()
|
||||
.Where(x => x.DeletedAt == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(x => x.TenantId == tenantId);
|
||||
query = query.Where(x => x.TenantId == tenantId.Value);
|
||||
}
|
||||
|
||||
// 2. (空行后) 执行软删除
|
||||
var existing = await query
|
||||
.Where(x => x.Id == holidayId)
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
|
||||
@@ -18,9 +18,9 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
public async Task<TenantSubscription?> FindByIdAsync(
|
||||
long subscriptionId,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
var query = ignoreTenantFilter
|
||||
var query = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -32,10 +32,10 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
public async Task<IReadOnlyList<TenantSubscription>> FindByIdsAsync(
|
||||
IEnumerable<long> subscriptionIds,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
var ids = subscriptionIds.ToList();
|
||||
var query = ignoreTenantFilter
|
||||
var query = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -48,10 +48,10 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
public async Task<(IReadOnlyList<SubscriptionWithRelations> Items, int Total)> SearchPagedAsync(
|
||||
SubscriptionSearchFilter filter,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
// 1. 构建基础查询
|
||||
var subscriptionQuery = ignoreTenantFilter
|
||||
var subscriptionQuery = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -134,9 +134,9 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
public async Task<SubscriptionDetailInfo?> GetDetailAsync(
|
||||
long subscriptionId,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
var subscriptionQuery = ignoreTenantFilter
|
||||
var subscriptionQuery = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -173,11 +173,11 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
public async Task<IReadOnlyList<SubscriptionWithTenant>> FindByIdsWithTenantAsync(
|
||||
IEnumerable<long> subscriptionIds,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
var ids = subscriptionIds.ToList();
|
||||
|
||||
var query = ignoreTenantFilter
|
||||
var query = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -201,10 +201,10 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
DateTime now,
|
||||
DateTime renewalThreshold,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
// 1. 查询开启自动续费且即将到期的活跃订阅
|
||||
var subscriptionQuery = ignoreTenantFilter
|
||||
var subscriptionQuery = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -232,10 +232,10 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
DateTime startOfDay,
|
||||
DateTime endOfDay,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
// 1. 查询到期落在指定区间的订阅(且未开启自动续费)
|
||||
var subscriptionQuery = ignoreTenantFilter
|
||||
var subscriptionQuery = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -268,9 +268,9 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
public async Task<IReadOnlyList<TenantSubscription>> FindExpiredActiveSubscriptionsAsync(
|
||||
DateTime now,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
var query = ignoreTenantFilter
|
||||
var query = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -285,9 +285,9 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
DateTime now,
|
||||
int gracePeriodDays,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
var query = ignoreTenantFilter
|
||||
var query = includeDeleted
|
||||
? dbContext.TenantSubscriptions.IgnoreQueryFilters()
|
||||
: dbContext.TenantSubscriptions;
|
||||
|
||||
@@ -364,9 +364,9 @@ public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, Ta
|
||||
public async Task<IReadOnlyList<TenantQuotaUsage>> GetQuotaUsagesAsync(
|
||||
long tenantId,
|
||||
CancellationToken cancellationToken = default,
|
||||
bool ignoreTenantFilter = false)
|
||||
bool includeDeleted = false)
|
||||
{
|
||||
var query = ignoreTenantFilter
|
||||
var query = includeDeleted
|
||||
? dbContext.TenantQuotaUsages.IgnoreQueryFilters()
|
||||
: dbContext.TenantQuotaUsages;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user