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.VendorService;
import com.ecep.contract.vo.VendorVo;

import jakarta.annotation.PostConstruct;

@Lazy
@Component
public class VendorStringConverter extends EntityStringConverter<VendorVo> {
    @Lazy
    @Autowired
    private VendorService service;

    public VendorStringConverter() {

    }

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


}