package com.eactive.eai.rms.onl.apim.portalproperty;

import com.eactive.apim.portal.portalproperty.entity.PortalPropertyGroup;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.onl.manage.comm.property.PropertyGroupUI;
import org.mapstruct.*;

@Mapper(componentModel = "spring", uses = { PortalPropertyMapper.class }, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface PortalPropertyGroupMapper extends GenericMapper<PropertyGroupUI, PortalPropertyGroup> {

	@Override
	@Mapping(source = "propertyGroupName", target = "prptyGroupName")
	@Mapping(source = "propertyGroupDesc", target = "prptyGroupDesc")
	@Mapping(source = "portalProperties", target = "gridData")
	PropertyGroupUI toVo(PortalPropertyGroup entity);

	@Override
	@InheritInverseConfiguration
	PortalPropertyGroup toEntity(PropertyGroupUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(PropertyGroupUI propertyGroupVo, @MappingTarget PortalPropertyGroup propGroup);

}
