package com.magistr.app.repository;

import com.magistr.app.model.TeacherCreationRequest;
import com.magistr.app.model.TeacherCreationRequestStatus;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface TeacherCreationRequestRepository extends JpaRepository<TeacherCreationRequest, Long> {

    List<TeacherCreationRequest> findByDepartment_IdOrderByCreatedAtDesc(Long departmentId);

    List<TeacherCreationRequest> findByStatusOrderByCreatedAtDesc(TeacherCreationRequestStatus status);

    List<TeacherCreationRequest> findAllByOrderByCreatedAtDesc();

    boolean existsByUsernameAndStatus(String username, TeacherCreationRequestStatus status);
}
