package com.eactive.eai.rms.onl.manage.rule.transform2.mapper;

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 com.eactive.eai.data.entity.onl.transformer.transform.TransformItemEntity;
import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.onl.manage.rule.transform2.ui.TransformItemUI;

@Mapper(config = BaseMapperConfig.class)
public interface TransformItemUIMapper extends GenericMapper<TransformItemUI, TransformItemEntity> {

	@Mapping(source = "id.cnvsnname", target = "cnvsnName")
	@Mapping(source = "id.cnvsnrsultitempathname", target = "cnvsnRsultItemPathName")
	@Mapping(source = "cnvsncmdname", target = "cnvsncmdname")
	@Mapping(source = "cnvsnitembascval", target = "cnvsnitembascval")
	@Mapping(source = "cnvsnitemserno", target = "cnvsnitemserno")
	TransformItemUI toVo(TransformItemEntity entity);

	@InheritInverseConfiguration
	TransformItemEntity toEntity(TransformItemUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.SET_TO_NULL)
	void updateEntity(TransformItemUI vo, @MappingTarget TransformItemEntity entity);
	
}
