package com.eactive.eai.rms.onl.manage.rule.transformfunc.map;

import org.mapstruct.BeanMapping;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;

import com.eactive.eai.data.entity.onl.transformer.function.Function;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.onl.manage.rule.transformfunc.ui.TransformFuncUI;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {
		TransformFuncParamManMapper.class })
public interface TransformFuncManMapper extends GenericMapper<TransformFuncUI, Function> {
	@Override
	@Mapping(source = "cnvsnfuntnname", target = "cnvsnFuntnName")
	@Mapping(source = "cnvsnfuntndesc", target = "cnvsnFuntnDesc")
	@Mapping(source = "cnvsnfuntnclsname", target = "cnvsnFuntnClsName")
	@Mapping(source = "cnvsnfuntnretunptrnidname", target = "cnvsnFuntnRetunPtrnIdName")
	@Mapping(source = "cnvsnfuntnptrnidname", target = "cnvsnFuntnPtrnIdName")
	TransformFuncUI toVo(Function entity);

	@Override
	@InheritInverseConfiguration
	Function toEntity(TransformFuncUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(TransformFuncUI vo, @MappingTarget Function entity);
}
