package com.eactive.eai.rms.onl.manage.serviceinfo.jmsqueue;

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.flowcontrol.jms.QueueMonitor;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface JmsQueueManMapper extends GenericMapper<JmsQueueManUI, QueueMonitor> {
	@Override
	@Mapping(target = "nonSynczTranQueName", source = "id.nonsyncztranquename")
	@Mapping(target = "sevrInstncName", source = "id.eaisevrinstncname")
	@Mapping(target = "bzwkDstcd", source = "eaibzwkdstcd")
	@Mapping(target = "queBzwkCtnt", source = "eaiquebzwkctnt")
	@Mapping(target = "queUseYn", source = "queuseyn")
	@Mapping(target = "queUsagDstcd", source = "queusagdstcd")
	@Mapping(target = "queBzwkDtalsCtnt", source = "eaiquebzwkdtalsctnt")
	@Mapping(target = "eaiQueCrtcnmvlVal", source = "eaiquecrtcnmvlval")
	JmsQueueManUI toVo(QueueMonitor entity);

	@Override
	@InheritInverseConfiguration
	QueueMonitor toEntity(JmsQueueManUI vo);

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