package com.alterdekim.game.repository;

import com.alterdekim.game.entity.Preloader;
import com.alterdekim.game.entity.Promotion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

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

@Repository
public interface PromotionRepository extends JpaRepository<Promotion, Long> {
    Optional<Promotion> findById(Long id);

    List<Promotion> findAll();

    @Query("SELECT p FROM Promotion p WHERE p.isSelected = true")
    List<Promotion> findSelected();
}