package kr.co.accura.wbx.spring.auth;

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

import java.util.Optional;

@Repository
public interface WbxUserRepository extends JpaRepository<WbxUser, Long> {

    Optional<WbxUser> findByEmail(String email);

    Optional<WbxUser> findByUsername(String username);

    Optional<WbxUser> findByAzureOid(String azureOid);

    Optional<WbxUser> findByEmployeeNumber(String employeeNumber);

    boolean existsByEmail(String email);

    boolean existsByUsername(String username);

    long countByIsActiveTrue();
}
