package com.ecep.contract.service;

import com.ecep.contract.vm.CompanyInvoiceInfoViewModel;
import com.ecep.contract.vo.CompanyInvoiceInfoVo;
import com.ecep.contract.vo.CompanyVo;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service

public class CompanyInvoiceInfoService extends QueryService<CompanyInvoiceInfoVo, CompanyInvoiceInfoViewModel> {

    public List<CompanyInvoiceInfoVo> searchByCompany(CompanyVo company, String searchText) {
        Map<String, Object> params = new HashMap<>();
        params.put("company", company);
        params.put("searchText", searchText);
        return findAll(params, Pageable.unpaged()).getContent();
    }
}
