using MktXService.Domain.SeedWork;

namespace MktXService.Domain.AggregatesModel.TemplateAggregate;

/// <summary>
/// EN: Repository interface for Template aggregate.
/// VI: Interface repository cho Template aggregate.
/// </summary>
public interface ITemplateRepository : IRepository<Template>
{
    /// <summary>
    /// EN: Add a new template.
    /// VI: Thêm một template mới.
    /// </summary>
    Template Add(Template template);

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

    /// <summary>
    /// EN: Delete a template.
    /// VI: Xóa một template.
    /// </summary>
    void Delete(Template template);

    /// <summary>
    /// EN: Get template by ID.
    /// VI: Lấy template theo ID.
    /// </summary>
    Task<Template?> GetByIdAsync(Guid id);

    /// <summary>
    /// EN: Get templates by merchant ID.
    /// VI: Lấy templates theo merchant ID.
    /// </summary>
    Task<IEnumerable<Template>> GetByMerchantIdAsync(Guid merchantId);

    /// <summary>
    /// EN: Get templates by type.
    /// VI: Lấy templates theo loại.
    /// </summary>
    Task<IEnumerable<Template>> GetByTypeAsync(Guid merchantId, string type);

    /// <summary>
    /// EN: Search templates by name.
    /// VI: Tìm kiếm templates theo tên.
    /// </summary>
    Task<IEnumerable<Template>> SearchByNameAsync(Guid merchantId, string searchTerm);
}
