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.CustomerService;
import com.ecep.contract.vo.CustomerVo;

import jakarta.annotation.PostConstruct;

@Lazy
@Component
public class CompanyCustomerStringConverter extends EntityStringConverter<CustomerVo> {
    @Lazy
    @Autowired
    private CustomerService service;

    public CompanyCustomerStringConverter() {

    }

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


}