// EN: Product repository interface.
// VI: Interface repository Product.

using CatalogService.Domain.SeedWork;

namespace CatalogService.Domain.AggregatesModel.ProductAggregate;

/// <summary>
/// EN: Repository interface for Product aggregate.
/// VI: Interface repository cho Product aggregate.
/// </summary>
public interface IProductRepository : IRepository<Product>
{
    /// <summary>
    /// EN: Add a new product.
    /// VI: Thêm sản phẩm mới.
    /// </summary>
    Product Add(Product product);

    /// <summary>
    /// EN: Update existing product.
    /// VI: Cập nhật sản phẩm hiện có.
    /// </summary>
    void Update(Product product);

    /// <summary>
    /// EN: Get product by ID.
    /// VI: Lấy sản phẩm theo ID.
    /// </summary>
    Task<Product?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get products by shop ID.
    /// VI: Lấy danh sách sản phẩm theo shop ID.
    /// </summary>
    Task<IEnumerable<Product>> GetByShopIdAsync(Guid shopId, CancellationToken cancellationToken = default);

    /// <summary>
    /// EN: Get products by type.
    /// VI: Lấy danh sách sản phẩm theo loại.
    /// </summary>
    Task<IEnumerable<Product>> GetByTypeAsync(Guid shopId, ProductType type, CancellationToken cancellationToken = default);
}
