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

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.adapter.AdapterType;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(componentModel = "spring", unmappedSourcePolicy = ReportingPolicy.IGNORE)
public interface AdapterTypeUIMapper extends GenericMapper<AdapterTypeUI, AdapterType> {

	@Override
	@Mapping(source = "adptrcd", target = "adptrCd")
	@Mapping(source = "adptrname", target = "adptrName")
	@Mapping(target = "gridData", ignore = true)
	@Mapping(target = "searchAdptrCd", ignore = true)
	AdapterTypeUI toVo(AdapterType entity);

	@Override
	@InheritInverseConfiguration
	AdapterType toEntity(AdapterTypeUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(AdapterTypeUI adapterTypeUI, @MappingTarget AdapterType adapterType);
	
}
