package com.eactive.eai.rms.onl.manage.serviceinfo.b2bextractor;

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

@Mapper(config = BaseMapperConfig.class)
public interface B2bExtractorUIMapper extends GenericMapper<B2bExtractorUI, B2BExtract> {

	@Mapping(source = "id.eaisvcname", target = "eaiSvcName")
	@Mapping(source = "id.svcprcssno", target = "svcPrcssNo")
	@Mapping(source = "adptrroutclsname", target = "adptrRoutClsName")
	@Mapping(source = "svcroutclsname", target = "svcRoutClsName")
	@Override
	B2bExtractorUI toVo(B2BExtract entity);

	@InheritInverseConfiguration
	@Override
	B2BExtract toEntity(B2bExtractorUI vo);

	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	@InheritInverseConfiguration
	void updateEntity(B2bExtractorUI b2bExtractorUI, @MappingTarget B2BExtract b2bExtract);

}
