using TakeoutSaaS.Domain.Coupons.Entities;
using TakeoutSaaS.Domain.Coupons.Enums;

namespace TakeoutSaaS.Domain.Coupons.Repositories;

/// <summary>
/// 营销活动仓储契约。
/// </summary>
public interface IPromotionCampaignRepository
{
    /// <summary>
    /// 查询租户下指定活动类型的活动列表。
    /// </summary>
    Task<IReadOnlyList<PromotionCampaign>> GetByPromotionTypeAsync(
        long tenantId,
        PromotionType promotionType,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// 查询活动详情。
    /// </summary>
    Task<PromotionCampaign?> FindByIdAsync(
        long campaignId,
        long tenantId,
        PromotionType promotionType,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// 新增活动。
    /// </summary>
    Task AddAsync(PromotionCampaign campaign, CancellationToken cancellationToken = default);

    /// <summary>
    /// 更新活动。
    /// </summary>
    Task UpdateAsync(PromotionCampaign campaign, CancellationToken cancellationToken = default);

    /// <summary>
    /// 删除活动。
    /// </summary>
    Task DeleteAsync(PromotionCampaign campaign, CancellationToken cancellationToken = default);

    /// <summary>
    /// 提交变更。
    /// </summary>
    Task SaveChangesAsync(CancellationToken cancellationToken = default);
}
