package me.zohar.runscore.useraccount.repo;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

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

import me.zohar.runscore.useraccount.domain.UserAccount;


public interface UserAccountRepo extends JpaRepository<UserAccount, String>, JpaSpecificationExecutor<UserAccount> {

  UserAccount findByUserName(String userName);

  Long countByInviterId(String inviterId);

  List<UserAccount> findAllByAccountType(String accountType);

  Optional<List<UserAccount>> findAllByAccountTypeAndState(String accountType, String state);
}
