package com.gcsc.connection.service.repository;

import com.gcsc.connection.service.entity.SnpService;
import com.gcsc.connection.service.entity.SnpServiceApi;
import org.springframework.data.jpa.repository.JpaRepository;

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

public interface SnpServiceApiRepository extends JpaRepository<SnpServiceApi, Long> {

    List<SnpServiceApi> findByService(SnpService service);

    List<SnpServiceApi> findByServiceServiceId(Long serviceId);

    Optional<SnpServiceApi> findByServiceServiceIdAndApiPathAndApiMethod(
        Long serviceId, String apiPath, String apiMethod);

    List<SnpServiceApi> findByServiceServiceIdAndIsActiveTrue(Long serviceId);

    List<SnpServiceApi> findTop10ByIsActiveTrueOrderByCreatedAtDesc();
}
