package de.accso.flexinale.ticketing.infrastructure.persistence;

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

import java.util.Optional;

@Repository
public interface KontingentJpaRepository extends JpaRepository<KontingentEntity, String> {

    @Query("SELECT k FROM Kontingent k " +
            "WHERE k.vorfuehrungId = :vorfuehrungId")
    Optional<KontingentEntity> findByVorfuehrung(final String vorfuehrungId);
}
