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

import jakarta.annotation.PostConstruct;

@Lazy
@Component
public class CompanyVendorStringConverter extends EntityStringConverter<CompanyVendorVo> {
    @Lazy
    @Autowired
    private CompanyVendorService service;

    public CompanyVendorStringConverter() {

    }

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


}