package com.vantec.screen.repository;

import java.io.Serializable;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.vantec.screen.entity.InventoryMaster;
import com.vantec.screen.entity.InventoryStatus;
import com.vantec.screen.entity.Location;
import com.vantec.screen.entity.Part;

public interface InventoryMasterRepository extends JpaRepository<InventoryMaster, Serializable>{

	List<InventoryMaster> findByLocationCode(String locationCode);
	
	List<InventoryMaster> findByLocation(Location location);
	
	List<InventoryMaster> findByCurrentLocation(Location location);
	
	List<InventoryMaster> findByPart(Part part);
	
//	@Query("select i from inventoryMaster i where i.locationCode = :locationCode and i.inventoryStatus in  :inventoryStatus")
//	List<InventoryMaster> findBylocationCodeAndInventoryStatusListNotIn(String locationCode,List<Long> inventoryStatus);
	
	InventoryMaster findBySerialReferenceAndPartNumber(String serialReference,String partNumber );
	
	List<InventoryMaster> findByTagReferenceLike(String tagReference);
	
	List<InventoryMaster> findByTagReference(String tagReference);

	List<InventoryMaster> findBylocationCodeAndInventoryStatusNotIn(String locationCode, InventoryStatus status);

	List<InventoryMaster> findByCurrentLocationAndInventoryStatus(Location location, InventoryStatus status);
	
	List<InventoryMaster> findByLocationCodeIn(List<Location> locations);
}

