package com.agent.management.repository;

import com.agent.management.model.entity.KbCategory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface KbCategoryRepository extends JpaRepository<KbCategory, Long> {

    List<KbCategory> findByParentIdOrderBySortOrderAscNameAsc(Long parentId);

    List<KbCategory> findAllByOrderBySortOrderAscNameAsc();

    boolean existsByParentId(Long parentId);
}
