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

import java.util.List;

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.mapper.GenericMapper;
import com.eactive.eai.rms.data.entity.onl.adapter.AdapterTypeProperty;

@Mapper(componentModel = "spring", unmappedSourcePolicy = ReportingPolicy.IGNORE)
public interface AdapterTypePropertyUIMapper extends GenericMapper<AdapterTypePropertyUI, AdapterTypeProperty> {

	@Override
	@Mapping(source = "id.adptrCd", target = "adptrCd")
	@Mapping(source = "id.adptrIoDstcd", target = "addAdptrIoDstCd")
	@Mapping(source = "id.adptrPrptyName", target = "addAdptrPrptyName")
	@Mapping(source = "adptrPrptyDesc", target = "addAdptrPrptyDesc")
	@Mapping(source = "dmnKnd", target = "DMNKND")
	AdapterTypePropertyUI toVo(AdapterTypeProperty entity);

	@Override
	@InheritInverseConfiguration
	AdapterTypeProperty toEntity(AdapterTypePropertyUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(AdapterTypePropertyUI adapterTypePropertyUI,
			@MappingTarget AdapterTypeProperty adapterTypeProperty);

	List<AdapterTypePropertyUI> toVoList(Iterable<AdapterTypeProperty> entities);
}
