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.CustomerEntityViewModel;
import com.ecep.contract.vo.CompanyCustomerEntityVo;
import com.ecep.contract.vo.CompanyCustomerVo;

@Service
public class CompanyCustomerEntityService extends QueryService<CompanyCustomerEntityVo, CustomerEntityViewModel> {
    public List<CompanyCustomerEntityVo> findAllByCustomer(CompanyCustomerVo customer) {
        return findAll(ParamUtils.builder()
                .equals("customer", customer.getId()).build(), Pageable.unpaged())
                .getContent();
    }
}
