package com.eactive.eai.rms.onl.manage.comm.property;

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

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

	@Override
	@Mapping(source = "prptygroupname", target = "prptyGroupName")
	@Mapping(source = "prptygroupdesc", target = "prptyGroupDesc")
	@Mapping(source = "props", target = "gridData")
	PropertyGroupUI toVo(PropGroup entity);

	@Override
	@InheritInverseConfiguration
	PropGroup toEntity(PropertyGroupUI vo);

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

}
