package com.nisum.mytime.repository;

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

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

import com.nisum.mytime.model.ProjectTeamMate;

public interface ProjectTeamMatesRepo
        extends MongoRepository<ProjectTeamMate, String> {

    List<ProjectTeamMate> findByProjectId(String projectId);

    List<ProjectTeamMate> findByEmployeeId(String employeeId);

    ProjectTeamMate findById(ObjectId id);

    ProjectTeamMate findByEmployeeIdAndProjectId(String employeeId,String projectId);

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

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

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