package ru.soune.nocopy.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import ru.soune.nocopy.entity.tarif.Tariff;
import ru.soune.nocopy.entity.tarif.TariffTimeTerm;
import ru.soune.nocopy.entity.tarif.TariffType;

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

@Repository
public interface TariffRepository extends JpaRepository<Tariff, Long> {
    Optional<Tariff> findByType(String type);
    List<Tariff> findAllByOrderByPriceAsc();
    List<Tariff> findByTariffAccountType(String typeAccount);
    List<Tariff> findByTariffAccountTypeAndTariffTerm(String typeAccount, TariffTimeTerm tariffTerm);
    Tariff findByName(String name);
}
