package com.eactive.eai.rms.onl.manage.comm.routing;

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.routing.Routing;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface RoutingUIMapper extends GenericMapper<RoutingUI, Routing> {

	@Override
	@Mapping(source = "routname", target = "routName")
	@Mapping(source = "motivrouturiname", target = "motivRoutUriName")
	@Mapping(source = "nonmotivrouturiname", target = "nonMotivRoutUriName")
	@Mapping(source = "layerdstcd", target = "layerDstcd")
	RoutingUI toVo(Routing entity);

	@Override
	@InheritInverseConfiguration
	Routing toEntity(RoutingUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(RoutingUI routingVo, @MappingTarget Routing routing);

}
