package com.eactive.eai.transformer.transform.mapper;

import org.mapstruct.CollectionMappingStrategy;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

import com.eactive.eai.data.entity.onl.transformer.transform.TransformItemEntity;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.transformer.transform.TransformItem;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, collectionMappingStrategy = CollectionMappingStrategy.ADDER_PREFERRED)
public interface TransformItemEntityMapper extends GenericMapper<TransformItem, TransformItemEntity> {

	
	@Mapping(source = "id.cnvsnname", target = "transform.name")
	@Mapping(source = "id.cnvsnrsultitempathname", target = "resultItemPath")
	@Mapping(source = "cnvsncmdname", target = "instruction")
	@Mapping(source = "cnvsnitembascval", target = "defaultValue")
	@Mapping(source = "cnvsnitemserno", target = "seqNo")
	@Override
	TransformItem toVo(TransformItemEntity entity);

	@InheritInverseConfiguration
	@Override
	TransformItemEntity toEntity(TransformItem vo);

}
