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

import com.eactive.apim.portal.portalorg.entity.PortalOrg;
import org.mapstruct.*;

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

	@Mapping(target = "approvalStatusDescription", expression = "java(entity.getApprovalStatus() != null ? entity.getApprovalStatus().getDescription() : \"\")")
	@Mapping(target = "orgStatusDescription", expression = "java(entity.getOrgStatus() != null ? entity.getOrgStatus().getDescription() : \"\")")
	PortalOrgUI toVo(PortalOrg entity);

	PortalOrg toEntity(PortalOrgUI vo);

	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(PortalOrgUI portalOrgUI, @MappingTarget PortalOrg portalOrg);

}
