package com.r11.tools.repository;

import com.r11.tools.model.MockedMessage;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Spring repository that allows to retrieve message list by key-uuid from redis database
 * @author Rafał Żukowicz
 */
@Repository
@Transactional
public interface MockedResponseRepository extends CrudRepository<MockedMessage, String> {
    /**
     * Finds all messages by their uuid
     * @param clientUUID the key-uuid of given set of messages
     * @return Optional of list of {@link com.r11.tools.model.MockedMessage}
     */
    Optional<List<MockedMessage>> findAllByClientUUID(UUID clientUUID);
}
