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.CompanyVendorApprovedItemVo;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.CompanyVendorVo;

@Service
public class CompanyVendorApprovedItemService
        extends QueryService<CompanyVendorApprovedItemVo, CompanyVendorApprovedItemViewModel> {

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

}
