using MembershipService.Domain.SeedWork;

namespace MembershipService.Domain.AggregatesModel.StampCardAggregate;

/// <summary>
/// EN: Repository interface for StampCard aggregate.
/// VI: Giao dien repository cho StampCard aggregate.
/// </summary>
public interface IStampCardRepository : IRepository<StampCard>
{
    /// <summary>
    /// EN: Get stamp card by ID.
    /// VI: Lay stamp card theo ID.
    /// </summary>
    Task<StampCard?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get active (non-completed or completed but unclaimed) stamp card for a member at a shop.
    /// VI: Lay stamp card dang hoat dong (chua hoan thanh hoac hoan thanh nhung chua nhan thuong) cho member tai shop.
    /// </summary>
    Task<StampCard?> GetActiveCardAsync(Guid shopId, Guid memberId, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get stamp card by member and shop.
    /// VI: Lay stamp card theo member va shop.
    /// </summary>
    Task<StampCard?> GetByMemberAndShopAsync(Guid shopId, Guid memberId, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get all stamp cards for a shop (admin view).
    /// VI: Lay tat ca stamp cards cho shop (admin view).
    /// </summary>
    Task<(IEnumerable<StampCard> Cards, int TotalCount)> GetByShopAsync(
        Guid shopId,
        int pageIndex,
        int pageSize,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Add a new stamp card.
    /// VI: Them stamp card moi.
    /// </summary>
    StampCard Add(StampCard stampCard);

    /// <summary>
    /// EN: Update an existing stamp card.
    /// VI: Cap nhat stamp card hien tai.
    /// </summary>
    void Update(StampCard stampCard);
}
