using ladaexpress.vn.Infrastructures.DTO.Models.Seo;

namespace ladaexpress.vn.Infrastructures.Services
{
    /// <summary>
    /// Service chuyên dụng cho quản lý breadcrumb
    /// </summary>
    public interface IBreadcrumbService
    {
        /// <summary>
        /// Tạo breadcrumbs cho trang chủ
        /// </summary>
        /// <returns></returns>
        Task<List<BreadcrumbItem>> GetHomeBreadcrumbsAsync();

        Task<List<BreadcrumbItem>> GetProductIndexBreadcrumbsAsync();
        Task<List<BreadcrumbItem>> GetJobPostIndexBreadcrumbsAsync();

        /// <summary>
        /// Tạo breadcrumbs cho trang sản phẩm
        /// </summary>
        /// <param name="productId">ID sản phẩm</param>
        /// <param name="productName">Tên sản phẩm</param>
        /// <param name="productUrl">URL sản phẩm</param>
        /// <param name="categoryName">Tên danh mục (optional)</param>
        /// <param name="categoryUrl">URL danh mục (optional)</param>
        /// <returns></returns>
        Task<List<BreadcrumbItem>> GetProductBreadcrumbsAsync(int productId, string productName, string productUrl, string? categoryName = null, string? categoryUrl = null);

        /// <summary>
        /// Tạo breadcrumbs cho trang tin tức
        /// </summary>
        /// <param name="postId">ID bài viết</param>
        /// <param name="postTitle">Tiêu đề bài viết</param>
        /// <param name="postUrl">URL bài viết</param>
        /// <param name="categoryName">Tên danh mục (optional)</param>
        /// <param name="categoryUrl">URL danh mục (optional)</param>
        /// <returns></returns>
        Task<List<BreadcrumbItem>> GetPostBreadcrumbsAsync(int postId, string postTitle, string postUrl, string? categoryName = null, string? categoryUrl = null);

        /// <summary>
        /// Tạo breadcrumbs cho trang danh mục
        /// </summary>
        /// <param name="categoryId">ID danh mục</param>
        /// <param name="categoryName">Tên danh mục</param>
        /// <param name="categoryUrl">URL danh mục</param>
        /// <param name="isProductCategory">Có phải danh mục sản phẩm không</param>
        /// <returns></returns>
        Task<List<BreadcrumbItem>> GetCategoryBreadcrumbsAsync(int categoryId, string categoryName, string categoryUrl, bool isProductCategory = true);

        /// <summary>
        /// Tạo breadcrumbs cho trang thẻ (tags)
        /// </summary>
        /// <param name="tagId">ID thẻ</param>
        /// <param name="tagName">Tên thẻ</param>
        /// <param name="tagUrl">URL thẻ</param>
        /// <returns></returns>
        Task<List<BreadcrumbItem>> GetTagBreadcrumbsAsync(int tagId, string tagName, string tagUrl);

        /// <summary>
        /// Tạo breadcrumbs cho trang tìm kiếm
        /// </summary>
        /// <param name="query">Từ khóa tìm kiếm</param>
        /// <param name="searchUrl">URL tìm kiếm</param>
        /// <returns></returns>
        Task<List<BreadcrumbItem>> GetSearchBreadcrumbsAsync(string query, string searchUrl);

        /// <summary>
        /// Tạo breadcrumbs tùy chỉnh
        /// </summary>
        /// <param name="items">Danh sách breadcrumb items</param>
        /// <returns></returns>
        Task<List<BreadcrumbItem>> CreateCustomBreadcrumbsAsync(params (string name, string url)[] items);

        /// <summary>
        /// Tạo breadcrumbs dựa trên path hierarchy
        /// </summary>
        /// <param name="path">URL path</param>
        /// <param name="currentPageName">Tên trang hiện tại</param>
        /// <returns></returns>
        Task<List<BreadcrumbItem>> CreateFromPathAsync(string path, string currentPageName);

        /// <summary>
        /// Validate breadcrumbs structure
        /// </summary>
        /// <param name="breadcrumbs">Danh sách breadcrumbs</param>
        /// <returns>List of validation errors</returns>
        List<string> ValidateBreadcrumbs(List<BreadcrumbItem> breadcrumbs);
    }
}