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.VendorGroupService;
import com.ecep.contract.vo.VendorGroupVo;

import jakarta.annotation.PostConstruct;

@Lazy
@Component
public class VendorGroupStringConverter extends EntityStringConverter<VendorGroupVo> {
    @Lazy
    @Autowired
    private VendorGroupService service;

    public VendorGroupStringConverter() {

    }

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


}