package com.eactive.eai.common.message.mapper;

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

import com.eactive.eai.common.message.ServiceMessage;
import com.eactive.eai.data.entity.onl.message.ServiceMessageEntity;
import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(config = BaseMapperConfig.class, uses = EAIReferenceMessageMapper.class)
public interface ServiceMessageMapper extends GenericMapper<ServiceMessage, ServiceMessageEntity> {
	@Mapping(source = "id.eaisvcname", target = "EAISvcCd")
	@Mapping(source = "id.svcprcssno", target = "svcPssSeq")
	@Mapping(source = "psvintfacdsticname", target = "psvItfTp")
	@Mapping(source = "psvsysbzwkdstcd", target = "psvBwkSysNm")
	@Mapping(source = "psvsysidname", target = "psvSysID")
	@Mapping(source = "psvsyssvcdsticname", target = "psvSysSvcCd")
	@Mapping(source = "psvsysadptrbzwkgroupname", target = "psvSysItfTp")
	@Mapping(source = "flovryn", target = "flOvrCls")
	@Mapping(source = "chngeonot", target = "cnvEn")
	@Mapping(source = "chngmsgidname", target = "cnvMsgID")
	@Mapping(source = "bascrspnsmsgcmprctnt", target = "bsRspMsgCprVl")
	@Mapping(source = "bascrspnschngeonot", target = "bsRspCnvEn")
	@Mapping(source = "bascrspnschngmsgidname", target = "bsRspCnvMsgID")
	@Mapping(source = "errrspnsmsgcmprctnt", target = "errRspMsgCprVl")
	@Mapping(source = "errrspnschngeonot", target = "errRspCnvEn")
	@Mapping(source = "errrspnschngmsgidname", target = "errRspCnvMsgID")
	@Mapping(source = "nextsvcprcssno", target = "nxtSvcPssSeq")
	@Mapping(source = "outbndroutname", target = "outbRtnNm")
	@Mapping(source = "toutval", target = "tmoVl")
	@Mapping(source = "cmpensvcprcssdsticname", target = "cpnsSvcPssCd")
	@Mapping(source = "suppldelyn", target = "supplDelYn")
	@Mapping(source = "hdrctrldstcd", target = "hdrCtrlDstcd")
	@Mapping(source = "hdrrefclsname", target = "hdrRefClsName")
	@Mapping(source = "restoption", target = "restOption")
	@Mapping(source = "timeoutcode", target = "timeoutCode")
	@Override
	ServiceMessage toVo(ServiceMessageEntity entity);

	@InheritInverseConfiguration
	@Override
	ServiceMessageEntity toEntity(ServiceMessage vo);

}
