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

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.FCQueueReceiver;
import com.eactive.eai.data.entity.onl.flowcontrol.jms.QueueMonitor;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.common.combo.ComboVo;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface JmsQueueReceiverManMapper extends GenericMapper<JmsQueueReceiverManUI, FCQueueReceiver> {
	@Override
	@Mapping(target = "queRcverName", source = "quercvername")
	@Mapping(target = "bascQueRcverYn", source = "bascquercveryn")
	@Mapping(target = "sevrInstncName", source = "eaisevrinstncname")
	@Mapping(target = "nonSynczTranObstclQueName", source = "nonsyncztranobstclquename")
	@Mapping(target = "nonSynczTranQueName", source = "nonsyncztranquename")
	@Mapping(target = "queMsgSelctCtnt", source = "quemsgselctctnt")
	@Mapping(target = "queRcverCnt", source = "quercvercnt")
	@Mapping(target = "queRcverDtalsCtnt", source = "quercverdtalsctnt")
	@Mapping(target = "sendDlayTtmVal", source = "senddlayttmval")
	@Mapping(target = "sendReTralNotms", source = "sendretralnotms")
	JmsQueueReceiverManUI toVo(FCQueueReceiver entity);

	@Override
	@InheritInverseConfiguration
	FCQueueReceiver toEntity(JmsQueueReceiverManUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(JmsQueueReceiverManUI vo, @MappingTarget FCQueueReceiver entity);
	
	@Mapping(source = "id.nonsyncztranquename", target = "code")
	@Mapping(source = "id.nonsyncztranquename", target = "codename")
	ComboVo toComboVo(QueueMonitor queueMonitor);
}
