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.ProjectIndustryService;
import com.ecep.contract.vo.ProjectIndustryVo;

import jakarta.annotation.PostConstruct;

@Lazy
@Component
public class ProjectIndustryStringConverter extends EntityStringConverter<ProjectIndustryVo> {
    @Lazy
    @Autowired
    private ProjectIndustryService service;

    public ProjectIndustryStringConverter() {

    }

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


}