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

import org.mapstruct.BeanMapping;
import org.mapstruct.InheritConfiguration;
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.data.entity.man.role.Role;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface RoleUIMapper extends GenericMapper<RoleUI, Role> {

	@Override
	@Mapping(source = "menuId", target = "roleScreen")
	RoleUI toVo(Role entity);

	@Override
	@InheritConfiguration
	Role toEntity(RoleUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(RoleUI roleUI, @MappingTarget Role role);

}
