package com.nisum.myteam.repository;

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

import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;

import com.nisum.myteam.model.dao.Resource;

public interface ResourceRepo
        extends MongoRepository<Resource, String> {

    List<Resource> findByProjectId(String projectId);

    List<Resource> findByEmployeeId(String employeeId);

    Resource findById(ObjectId id);

    Resource findByEmployeeIdAndProjectId(String employeeId,String projectId);

    List<Resource> findByEmployeeIdAndActive(String employeeId,boolean status);

    List<Resource> findByEmployeeIdAndProjectIdAndActive(String employeeId, String projectId, boolean status);

    List<Resource> findByAccountAndActiveAndBillableStatus( String account, boolean status, String billableStatus);
    
    Optional<List<Resource>> findByActiveAndShiftLikeOrderByEmployeeIdDesc( boolean active, String shift);
}
