feat: 完成营销中心优惠券后端模块
All checks were successful
Build and Deploy TenantApi + SkuWorker / build-and-deploy (push) Successful in 1m54s
All checks were successful
Build and Deploy TenantApi + SkuWorker / build-and-deploy (push) Successful in 1m54s
This commit is contained in:
@@ -53,6 +53,11 @@ public sealed class CouponTemplate : MultiTenantEntityBase
|
||||
/// </summary>
|
||||
public int? TotalQuantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 每位用户可领取上限。
|
||||
/// </summary>
|
||||
public int? PerUserLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 已领取数量。
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
using TakeoutSaaS.Domain.Coupons.Entities;
|
||||
|
||||
namespace TakeoutSaaS.Domain.Coupons.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// 优惠券聚合仓储契约。
|
||||
/// </summary>
|
||||
public interface ICouponRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询租户下的券模板列表。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<CouponTemplate>> GetTemplatesAsync(long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按标识查询券模板。
|
||||
/// </summary>
|
||||
Task<CouponTemplate?> FindTemplateByIdAsync(long templateId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增券模板。
|
||||
/// </summary>
|
||||
Task AddTemplateAsync(CouponTemplate template, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 更新券模板。
|
||||
/// </summary>
|
||||
Task UpdateTemplateAsync(CouponTemplate template, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 删除券模板。
|
||||
/// </summary>
|
||||
Task DeleteTemplateAsync(CouponTemplate template, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 统计模板下已发放券总数。
|
||||
/// </summary>
|
||||
Task<int> CountIssuedCouponsByTemplateIdAsync(long tenantId, long templateId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按模板统计已核销券数量。
|
||||
/// </summary>
|
||||
Task<Dictionary<long, int>> CountRedeemedCouponsByTemplateIdsAsync(
|
||||
long tenantId,
|
||||
IReadOnlyCollection<long> templateIds,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 持久化变更。
|
||||
/// </summary>
|
||||
Task SaveChangesAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user