package com.ecep.contract.converter;

import com.ecep.contract.model.ContractType;
import com.ecep.contract.service.ContractTypeService;

public class ContractTypeStringConverter extends EntityStringConverter<ContractType> {
    ContractTypeService contractTypeService;

    public ContractTypeStringConverter(ContractTypeService contractTypeService) {
        this.contractTypeService = contractTypeService;
        init();
    }

    private void init() {
        setInitialized(project -> contractTypeService.findById(project.getId()));
        setSuggestion(contractTypeService::search);
        setFromString(contractTypeService::findByName);
    }

}
