package com.eactive.eai.rms.onl.manage.adapter.messagekey;

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.messagekey.MessageKey;
import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(config = BaseMapperConfig.class)
public interface MessageKeyUIMapper extends GenericMapper<MessageKeyUI, MessageKey> {

	@Mapping(source = "id.adptrbzwkgroupname", target = "adptrBzwkGroupName")
	@Mapping(source = "id.msgdstcd", target = "msgDstcd")
	@Mapping(source = "id.iodstcd", target = "ioDstcd")
	@Mapping(source = "id.groupinorno", target = "groupInorNo")
	@Mapping(source = "id.fldprcssno", target = "fldPrcssNo")
	@Override
	MessageKeyUI toVo(MessageKey entity);

	@InheritInverseConfiguration
	@Override
	MessageKey toEntity(MessageKeyUI vo);

	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateMessageKey(MessageKey source, @MappingTarget MessageKey target);

}
