package com.eactive.eai.rms.onl.manage.serviceinfo.eaimsg.mapping;

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.message.ServiceMessageEntity;
import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.onl.manage.serviceinfo.eaimsg.ui.ServiceMessageUI;

@Mapper(config = BaseMapperConfig.class, uses = { CondPerRtgInfoUIMapper.class, EAIReferenceMessageUIMapper.class })
public interface ServiceMessageUIMapper extends GenericMapper<ServiceMessageUI, ServiceMessageEntity> {

	@Override
	@Mapping(source = "id.eaisvcname", target = "eaiSvcName")
	@Mapping(source = "id.svcprcssno", target = "svcPrcssNo")
	@Mapping(source = "bascrspnschngeonot", target = "bascRspnsChngEonot")
	@Mapping(source = "bascrspnschngmsgidname", target = "bascRspnsChngMsgIdName")
	@Mapping(source = "bascrspnsmsgcmprctnt", target = "bascRspnsMsgCmprCtnt")
	@Mapping(source = "chngeonot", target = "chngEonot")
	@Mapping(source = "chngmsgidname", target = "chngMsgIdName")
	@Mapping(source = "cmpensvcprcssdsticname", target = "cmpenSvcPrcssDsticName")
	@Mapping(source = "errrspnschngeonot", target = "errRspnsChngEonot")
	@Mapping(source = "errrspnschngmsgidname", target = "errRspnsChngMsgIdName")
	@Mapping(source = "errrspnsmsgcmprctnt", target = "errRspnsMsgCmprCtnt")
	@Mapping(source = "flovryn", target = "flovrYn")
	@Mapping(source = "hdrctrldstcd", target = "hdrCtrlDstcd")
	@Mapping(source = "hdrrefclsname", target = "hdrRefClsName")
	@Mapping(source = "nextsvcprcssno", target = "nextSvcPrcssNo")
	@Mapping(source = "outbndroutname", target = "outbndRoutName")
	@Mapping(source = "psvintfacdsticname", target = "psvIntfacDsticName")
	@Mapping(source = "psvsysadptrbzwkgroupname", target = "psvSysAdptrBzwkGroupName")
	@Mapping(source = "psvsysbzwkdstcd", target = "psvSysBzwkDstcd")
	@Mapping(source = "psvsysidname", target = "psvsysidname")
	@Mapping(source = "psvsyssvcdsticname", target = "psvSysSvcDsticName")
	@Mapping(source = "restoption", target = "restOption")
	@Mapping(source = "suppldelyn", target = "supplDelYn")
	@Mapping(source = "timeoutcode", target = "timeoutcode")
	@Mapping(source = "toutval", target = "toutVal")
	ServiceMessageUI toVo(ServiceMessageEntity entity);

	@InheritInverseConfiguration
	@Override
	ServiceMessageEntity toEntity(ServiceMessageUI vo);

	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	@InheritInverseConfiguration
	ServiceMessageEntity updateEntity(ServiceMessageUI vo, @MappingTarget ServiceMessageEntity entity);

}
