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

import inn.ocsf.bee.freigeld.core.model.data.CoinAccountLink;
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;

public interface CoinAccountLinkRepository extends MongoRepository<CoinAccountLink, ObjectId>, QuerydslPredicateExecutor<CoinAccountLink> {

    @NotNull
    List<CoinAccountLink> findAllByAccountId(@NotNull UUID id);

    @NotNull
    Optional<CoinAccountLink> findOneByAccountIdAndCoinId(@NotNull UUID accountId, @NotNull UUID coinId);
}
