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.Parameter;
import com.eactive.eai.data.entity.onl.transformer.layout.LayoutTypeEntity;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.onl.manage.rule.layouttype.LayoutTypeUI;
import com.eactive.eai.rms.onl.manage.rule.transformfunc.ui.TransformFuncParamUI;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TransformFuncParamManMapper extends GenericMapper<TransformFuncParamUI, Parameter> {
	

	@Override
	@Mapping(source = "id.cnvsnfuntnname", target = "cnvsnFuntnName")
	@Mapping(source = "id.cnvsnfuntnparmname", target = "cnvsnFuntnParmName")
	@Mapping(source = "cnvsnfuntnparmdesc", target = "cnvsnFuntnParmDesc")
	@Mapping(source = "cnvsnfuntnparmptrnidname", target = "cnvsnFuntnParmPtrnIdName")
	@Mapping(source = "cnvsnfuntnparmserno", target = "cnvsnFuntnParmSerno")
	TransformFuncParamUI toVo(Parameter entity);

	@Override
	@InheritInverseConfiguration
	Parameter toEntity(TransformFuncParamUI vo);

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