package com.gnx.telemedicine.repository;

import com.gnx.telemedicine.model.DataSubjectRequest;
import com.gnx.telemedicine.model.UserModel;
import com.gnx.telemedicine.model.enums.DataSubjectRequestStatus;
import com.gnx.telemedicine.model.enums.DataSubjectRequestType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

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

@Repository
public interface DataSubjectRequestRepository extends JpaRepository<DataSubjectRequest, UUID> {
    List<DataSubjectRequest> findByUser(UserModel user);
    
    List<DataSubjectRequest> findByRequestStatus(DataSubjectRequestStatus status);
    
    List<DataSubjectRequest> findByRequestType(DataSubjectRequestType requestType);
    
    Optional<DataSubjectRequest> findByVerificationToken(String token);
    
    List<DataSubjectRequest> findByUserAndRequestType(UserModel user, DataSubjectRequestType requestType);
}

