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

import com.eactive.apim.portal.portaluser.entity.PortalUser;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface PortalUserCorpManagerUIMapper {

	@Mapping(source = "portalOrg.id", target = "orgId")
	@Mapping(target = "userStatusDescription", expression = "java(entity.getUserStatus() != null ? entity.getUserStatus().getDescription() : \"\")")
	@Mapping(target = "roleCodeDescription", expression = "java(entity.getRoleCode() != null ? entity.getRoleCode().getDescription() : \"\")")
	PortalUserCorpManagerUI toVo(PortalUser entity);
}
