package com.magistr.app.repository;

import com.magistr.app.model.TimeSlotScope;
import org.springframework.data.jpa.repository.JpaRepository;

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

public interface TimeSlotScopeRepository extends JpaRepository<TimeSlotScope, Long> {

    List<TimeSlotScope> findAllByOrderByDisplayOrderAscNameAsc();

    Optional<TimeSlotScope> findByCode(String code);

    Optional<TimeSlotScope> findFirstByApplyModeOrderByDisplayOrderAsc(String applyMode);

    Optional<TimeSlotScope> findByApplyModeAndDayOfWeek(String applyMode, Integer dayOfWeek);
}
