package com.izouma.jmrh.repo;

import com.izouma.jmrh.domain.DockingRecord;
import com.izouma.jmrh.enums.DockingRole;
import com.izouma.jmrh.enums.DockingStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;


public interface DockingRecordRepo extends JpaRepository<DockingRecord, Long>, JpaSpecificationExecutor<DockingRecord> {
    DockingRecord findFirstByUserIdAndSndIdAndRoleAndStatusInOrderByIdDesc(Long userId, Long sndId, DockingRole role, Iterable<DockingStatus> status);

    DockingRecord findFirstByUserIdAndSndIdAndRoleOrderByIdDesc(Long userId, Long sndId, DockingRole role);

    DockingRecord findFirstByUserIdAndSndIdAndStatusInOrderByIdDesc(Long userId, Long sndId, Iterable<DockingStatus> status);
}