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.DepartmentService;
import com.ecep.contract.vo.DepartmentVo;

import jakarta.annotation.PostConstruct;

@Lazy
@Component
public class DepartmentStringConverter extends EntityStringConverter<DepartmentVo> {
    @Lazy
    @Autowired
    private DepartmentService service;

    public DepartmentStringConverter() {

    }

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


}