package com.eactive.eai.rms.common.acl.menu;

import org.mapstruct.BeanMapping;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
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.acl.menu.ui.MenuUI;
import com.eactive.eai.rms.data.entity.man.menu.Menu;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface MenuUIMapper extends GenericMapper<MenuUI, Menu> {

	@Override
	MenuUI toVo(Menu entity);

	@Override
	@InheritInverseConfiguration
	Menu toEntity(MenuUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(MenuUI menuUI, @MappingTarget Menu menu);
}
