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

import inn.ocsf.bee.freigeld.core.model.data.CoinData;
import inn.ocsf.bee.freigeld.core.model.data.CoinStatus;
import org.bson.types.ObjectId;
import org.jetbrains.annotations.NotNull;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;

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

public interface CoinRepository extends MongoRepository<CoinData, ObjectId>, QuerydslPredicateExecutor<CoinData>, CoinRepositoryCustom {

    Optional<CoinData> findOneByCoinId(UUID coin_id);

    Stream<CoinData> findAllByStatus(CoinStatus status);

    @NotNull
    List<CoinData> findAllByCoinIdIn(@NotNull List<UUID> ids);
}
