package com.mvrent.carrental.repository;

import com.mvrent.carrental.model.Category;
import com.mvrent.carrental.model.CategoryType;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface CategoryRepository extends JpaRepository<Category, Long> {
    List<Category> findByTypeOrderByName(CategoryType type);
    List<Category> findByTypeAndActiveTrueOrderByName(CategoryType type);
    List<Category> findAllByOrderByTypeAscNameAsc();
    boolean existsByTypeAndName(CategoryType type, String name);
}
