package com.davos.assessment.profile;

import com.davos.assessment.user.AppUser;
import com.davos.assessment.project.Project;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;

public interface ProfileRepository extends JpaRepository<Profile, Long> {
  Optional<Profile> findByUser(AppUser user);
  Optional<Profile> findByProjectAndUser(Project project, AppUser user);
  Optional<Profile> findByProjectAndUserId(Project project, Long userId);
  Optional<Profile> findByUserId(Long userId);
  List<Profile> findByProjectAndUserIdIn(Project project, Collection<Long> userIds);
  List<Profile> findByUserIdIn(Collection<Long> userIds);
}
