package com.ecep.contract.service;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vm.ContractItemViewModel;
import com.ecep.contract.vo.ContractItemVo;
import com.ecep.contract.vo.InventoryVo;

@Service
public class ContractItemService extends QueryService<ContractItemVo, ContractItemViewModel> {

    public List<ContractItemVo> findAllByInventory(InventoryVo parent) {
        return findAll(ParamUtils.builder().equals("inventory", parent.getId()).build(), Pageable.unpaged())
                .getContent();
    }

}
