package io.github.javageeks.mase.repository;

import io.github.javageeks.mase.model.Todo;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * Interface for todo repository.
 */
public interface TodoRepository extends MongoRepository<Todo, String> {

    /**
     * Find todo list by user id.
     * @param userId the user id
     * @return the todo list for the given user
     */
    List<Todo> findByUserId(long userId);

    /**
     * Find todo list by title.
     * @param userId the userId
     * @param title the todo title
     * @return the todo list with the given todo title
     */
    List<Todo> findByUserIdAndTitleLike(long userId, String title);

    /**
     * Find todo list by description.
     * @param userId the user id
     * @param description the todo description
     * @return the todo list with the given todo description
     */
    List<Todo> findByUserIdAndDescriptionLike(long userId, String description);

    /**
     * Find todo list by todo status.
     * @param userId the user id
     * @param status the todo status
     * @return the todo list with the given todo status
     */
    List<Todo> findByUserIdAndStatusIsTrue(long userId, boolean status);

}

@@ -450,18 +450,20 @@
 yUserId(
-lo
+Stri
 ng userI
@@ -673,26 +673,28 @@
 ndTitleLike(
-lo
+Stri
 ng userId, S
@@ -949,18 +949,20 @@
 ionLike(
-lo
+Stri
 ng userI
@@ -1213,10 +1213,12 @@
 rue(
-lo
+Stri
 ng u

change user id type to String