package com.ecep.contract.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import com.ecep.contract.service.CompanyCustomerService;
import com.ecep.contract.vo.CompanyCustomerVo;

import jakarta.annotation.PostConstruct;

@Lazy
@Component
public class CompanyCustomerStringConverter extends EntityStringConverter<CompanyCustomerVo> {
    @Lazy
    @Autowired
    private CompanyCustomerService service;

    public CompanyCustomerStringConverter() {

    }

    @PostConstruct
    private void init() {
        setInitialized(customer -> service.findById(customer.getId()));
        setSuggestion(service::search);
    }


}