using WhatsAppService.Domain.SeedWork;

namespace WhatsAppService.Domain.AggregatesModel.CustomerAggregate;

/// <summary>
/// EN: Repository interface for Customer aggregate root.
/// VI: Interface repository cho Customer aggregate root.
/// </summary>
public interface ICustomerRepository : IRepository<Customer>
{
    /// <summary>
    /// EN: Add a new customer.
    /// VI: Thêm một customer mới.
    /// </summary>
    Task<Customer> AddAsync(Customer customer, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Update an existing customer.
    /// VI: Cập nhật một customer đã tồn tại.
    /// </summary>
    void Update(Customer customer);

    /// <summary>
    /// EN: Get a customer by ID.
    /// VI: Lấy một customer theo ID.
    /// </summary>
    Task<Customer?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get a customer by WhatsApp ID (phone number) within a shop.
    /// VI: Lấy một customer theo WhatsApp ID (số điện thoại) trong một shop.
    /// </summary>
    Task<Customer?> GetByWaIdAsync(Guid shopId, string waId, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get customers by shop ID with pagination.
    /// VI: Lấy customers theo shop ID với phân trang.
    /// </summary>
    Task<IReadOnlyList<Customer>> GetByShopIdAsync(Guid shopId, int skip, int take, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get customers by tags.
    /// VI: Lấy customers theo tags.
    /// </summary>
    Task<IReadOnlyList<Customer>> GetByTagsAsync(Guid shopId, IEnumerable<string> tags, CancellationToken cancellationToken = default);
}
