using FacebookService.Domain.SeedWork;

namespace FacebookService.Domain.AggregatesModel.CustomerAggregate;

/// <summary>
/// EN: Repository interface for Customer aggregate.
/// VI: Interface repository cho Customer aggregate.
/// </summary>
public interface ICustomerRepository : IRepository<Customer>
{
    /// <summary>
    /// EN: Get customer by Facebook User ID.
    /// VI: Lấy customer theo Facebook User ID.
    /// </summary>
    /// <param name="facebookUserId">EN: Facebook user ID / VI: ID người dùng Facebook</param>
    /// <param name="cancellationToken">EN: Cancellation token / VI: Token hủy</param>
    /// <returns>EN: Customer or null / VI: Customer hoặc null</returns>
    Task<Customer?> GetByFacebookUserIdAsync(string facebookUserId, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get customer by ID with all related data.
    /// VI: Lấy customer theo ID với tất cả dữ liệu liên quan.
    /// </summary>
    Task<Customer?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Add a new customer.
    /// VI: Thêm customer mới.
    /// </summary>
    Customer Add(Customer customer);

    /// <summary>
    /// EN: Update an existing customer.
    /// VI: Cập nhật customer hiện có.
    /// </summary>
    void Update(Customer customer);

    /// <summary>
    /// EN: Check if customer exists by Facebook User ID.
    /// VI: Kiểm tra customer có tồn tại theo Facebook User ID.
    /// </summary>
    Task<bool> ExistsByFacebookUserIdAsync(string facebookUserId, CancellationToken cancellationToken = default);
}
