package inn.ocsf.bee.freigeld.core.repo;

import inn.ocsf.bee.freigeld.core.model.data.PersonData;
import inn.ocsf.bee.freigeld.core.model.data.PersonDataPrj0;
import inn.ocsf.bee.freigeld.core.model.data.PersonIdentityPrj0;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;

import java.util.Optional;
import java.util.UUID;
import java.util.stream.Stream;

public interface PersonRepository extends MongoRepository<PersonData, ObjectId>, QuerydslPredicateExecutor<PersonData>, PersonRepositoryCustom {

    Optional<PersonData> findOneByPersonId(UUID person_id);

    Stream<PersonDataPrj0> findAllBy();

    @Query("{}")
    Stream<PersonIdentityPrj0> findAllBy0();
}
