package com.realnet.DynamicDashbard.repositories;

import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.realnet.DynamicDashbard.entities.ChartTemplate;
import com.realnet.DynamicDashbard.entities.ChartType;

@Repository
public interface ChartTemplateRepository extends JpaRepository<ChartTemplate, Long> {
	List<ChartTemplate> findByChartType(ChartType chartType);

	Optional<ChartTemplate> findByChartTypeAndIsDefaultTrue(ChartType chartType);

	List<ChartTemplate> findByChartTypeAndTemplateNameContainingIgnoreCase(ChartType chartType, String templateName);
}