package de.assecutor.votianlt.repository;

import de.assecutor.votianlt.model.TaskTemplate;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface TaskTemplateRepository extends MongoRepository<TaskTemplate, ObjectId> {

    List<TaskTemplate> findByUserIdOrderByTemplateNameAsc(ObjectId userId);

    Optional<TaskTemplate> findByUserIdAndTemplateName(ObjectId userId, String templateName);

    void deleteByUserIdAndTemplateName(ObjectId userId, String templateName);
}