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.CompanyVendorApprovedItemViewModel;
import com.ecep.contract.vo.VendorApprovedItemVo;
import com.ecep.contract.vo.VendorApprovedVo;
import com.ecep.contract.vo.VendorVo;

@Service
public class VendorApprovedItemService
        extends QueryService<VendorApprovedItemVo, CompanyVendorApprovedItemViewModel> {

    public List<VendorApprovedItemVo> findAllByListAndVendor(VendorApprovedVo approvedList,
                                                             VendorVo vendor) {
        return findAll(ParamUtils.builder()
                .equals("list", approvedList.getId())
                .equals("vendor", vendor.getId())
                .build(), Pageable.unpaged()).getContent();
    }

}
