package com.example.demo.repository;

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

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.example.demo.model.StoryboardVideoTask;

@Repository
public interface StoryboardVideoTaskRepository extends JpaRepository<StoryboardVideoTask, Long> {
    
    Optional<StoryboardVideoTask> findByTaskId(String taskId);
    
    List<StoryboardVideoTask> findByUsernameOrderByCreatedAtDesc(String username);
    
    Page<StoryboardVideoTask> findByUsernameOrderByCreatedAtDesc(String username, Pageable pageable);
    
    List<StoryboardVideoTask> findByStatus(StoryboardVideoTask.TaskStatus status);
}
