package com.eactive.eai.rms.common.property.mapper;

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.common.property.UI.MonitoringPropertyGroupUI;
import com.eactive.eai.rms.data.entity.man.monitoringProperty.MonitoringPropertyGroup;

@Mapper(componentModel = "spring", uses = {MonitoringPropertyMapper.class }, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface MonitoringPropertyGroupMapper extends GenericMapper<MonitoringPropertyGroupUI, MonitoringPropertyGroup> {

	@Override
	@Mapping(source = "monitoringProperties", target = "gridData")
	MonitoringPropertyGroupUI toVo(MonitoringPropertyGroup entity);

	@Override
	@InheritInverseConfiguration
	MonitoringPropertyGroup toEntity(MonitoringPropertyGroupUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(MonitoringPropertyGroupUI monitoringPropertyGroupUI,
			@MappingTarget MonitoringPropertyGroup monitoringPropertyGroup);
}
