package ru.soune.nocopy.repository;

import jakarta.validation.constraints.Size;
import org.springframework.data.jpa.repository.JpaRepository;
import ru.soune.nocopy.entity.user.User;

import java.util.List;

public interface UserRepository extends JpaRepository<User, Long> {
    User findByEmail(String email);
    boolean existsByEmail(String email);
    boolean existsByPhone(@Size(min = 11, max = 14) String phone);
    List<User> findByCompanyId(String companyId);
    long countByCompanyId(String companyId);
}
