package cz.utb.tadis.auth.repository;

import cz.utb.tadis.auth.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

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

@Repository
public interface UserRepository extends JpaRepository<User, Long> {

    Optional<User> findByEmail(String email);
    Optional<User> findByIdAndActive(Long id, Boolean active);
    List<User> findAllByRoleName(String name);
    Optional<User> findByEmailAndActive(String email, Boolean active);
    void deleteByIdAndActive(Long id, Boolean active);

}
