refactor: AdminApi 剔除租户侧能力
This commit is contained in:
@@ -16,17 +16,17 @@ public interface IInventoryRepository
|
||||
/// <summary>
|
||||
/// 依据标识查询库存。
|
||||
/// </summary>
|
||||
Task<InventoryItem?> FindByIdAsync(long inventoryItemId, long tenantId, CancellationToken cancellationToken = default);
|
||||
Task<InventoryItem?> FindByIdAsync(long inventoryItemId, long? tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按门店与 SKU 查询库存(只读)。
|
||||
/// </summary>
|
||||
Task<InventoryItem?> FindBySkuAsync(long tenantId, long storeId, long productSkuId, CancellationToken cancellationToken = default);
|
||||
Task<InventoryItem?> FindBySkuAsync(long? tenantId, long storeId, long productSkuId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按门店与 SKU 查询库存(跟踪用于更新)。
|
||||
/// </summary>
|
||||
Task<InventoryItem?> GetForUpdateAsync(long tenantId, long storeId, long productSkuId, CancellationToken cancellationToken = default);
|
||||
Task<InventoryItem?> GetForUpdateAsync(long? tenantId, long storeId, long productSkuId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增库存记录。
|
||||
@@ -51,7 +51,7 @@ public interface IInventoryRepository
|
||||
/// <summary>
|
||||
/// 按幂等键查询锁记录。
|
||||
/// </summary>
|
||||
Task<InventoryLockRecord?> FindLockByKeyAsync(long tenantId, string idempotencyKey, CancellationToken cancellationToken = default);
|
||||
Task<InventoryLockRecord?> FindLockByKeyAsync(long? tenantId, string idempotencyKey, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 更新锁状态。
|
||||
@@ -61,22 +61,22 @@ public interface IInventoryRepository
|
||||
/// <summary>
|
||||
/// 查询过期锁定。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<InventoryLockRecord>> FindExpiredLocksAsync(long tenantId, DateTime utcNow, CancellationToken cancellationToken = default);
|
||||
Task<IReadOnlyList<InventoryLockRecord>> FindExpiredLocksAsync(long? tenantId, DateTime utcNow, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询批次列表。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<InventoryBatch>> GetBatchesAsync(long tenantId, long storeId, long productSkuId, CancellationToken cancellationToken = default);
|
||||
Task<IReadOnlyList<InventoryBatch>> GetBatchesAsync(long? tenantId, long storeId, long productSkuId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 批次扣减读取(带排序策略)。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<InventoryBatch>> GetBatchesForConsumeAsync(long tenantId, long storeId, long productSkuId, InventoryBatchConsumeStrategy strategy, CancellationToken cancellationToken = default);
|
||||
Task<IReadOnlyList<InventoryBatch>> GetBatchesForConsumeAsync(long? tenantId, long storeId, long productSkuId, InventoryBatchConsumeStrategy strategy, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询批次(跟踪用于更新)。
|
||||
/// </summary>
|
||||
Task<InventoryBatch?> GetBatchForUpdateAsync(long tenantId, long storeId, long productSkuId, string batchNumber, CancellationToken cancellationToken = default);
|
||||
Task<InventoryBatch?> GetBatchForUpdateAsync(long? tenantId, long storeId, long productSkuId, string batchNumber, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增批次。
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
using TakeoutSaaS.Domain.Tenants.Entities;
|
||||
|
||||
namespace TakeoutSaaS.Domain.Tenants.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// 公告已读仓储。
|
||||
/// </summary>
|
||||
public interface ITenantAnnouncementReadRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 按公告查询已读记录。
|
||||
/// </summary>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="announcementId">公告 ID。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>指定公告的已读列表。</returns>
|
||||
Task<IReadOnlyList<TenantAnnouncementRead>> GetByAnnouncementAsync(long tenantId, long announcementId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 批量按公告查询已读记录,可选按用户过滤。
|
||||
/// </summary>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="announcementIds">公告 ID 集合。</param>
|
||||
/// <param name="userId">用户 ID,空则不按用户筛选。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>匹配条件的已读列表。</returns>
|
||||
Task<IReadOnlyList<TenantAnnouncementRead>> GetByAnnouncementAsync(long tenantId, IEnumerable<long> announcementIds, long? userId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询指定用户对某公告的已读记录。
|
||||
/// </summary>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="announcementId">公告 ID。</param>
|
||||
/// <param name="userId">用户 ID。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>已读记录,未读返回 null。</returns>
|
||||
Task<TenantAnnouncementRead?> FindAsync(long tenantId, long announcementId, long? userId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增已读记录。
|
||||
/// </summary>
|
||||
/// <param name="record">已读实体。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>异步任务。</returns>
|
||||
Task AddAsync(TenantAnnouncementRead record, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 保存变更。
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>异步任务。</returns>
|
||||
Task SaveChangesAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -36,33 +36,6 @@ public interface ITenantAnnouncementRepository
|
||||
int? limit = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按 ID 获取公告(包含平台公告 TenantId=0)。
|
||||
/// </summary>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="announcementId">公告 ID。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>公告实体或 null。</returns>
|
||||
Task<TenantAnnouncement?> FindByIdInScopeAsync(long tenantId, long announcementId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询未读公告(包含平台公告 TenantId=0)。
|
||||
/// </summary>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="userId">用户 ID。</param>
|
||||
/// <param name="status">公告状态。</param>
|
||||
/// <param name="isActive">启用状态。</param>
|
||||
/// <param name="effectiveAt">生效时间点,为空不限制。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>未读公告集合。</returns>
|
||||
Task<IReadOnlyList<TenantAnnouncement>> SearchUnreadAsync(
|
||||
long tenantId,
|
||||
long? userId,
|
||||
AnnouncementStatus? status,
|
||||
bool? isActive,
|
||||
DateTime? effectiveAt,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按 ID 获取公告。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user