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

import com.eactive.apim.portal.portalproperty.entity.PortalProperty;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.onl.manage.comm.property.PropertyUI;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface PortalPropertyMapper extends GenericMapper<PropertyUI, PortalProperty> {

	@Mapping(source = "prptyGroupName", target = "id.propertyGroupName")
	@Mapping(source = "prptyName", target = "id.propertyName")
	@Mapping(source = "prpty2Val", target = "propertyValue")
	@Mapping(source = "prptyDesc", target = "propertyDesc")
	@Override
	PortalProperty toEntity(PropertyUI vo);


	@Mapping(source ="id.propertyGroupName", target = "prptyGroupName")
	@Mapping(source ="id.propertyName", target = "prptyName")
	@Mapping(source ="propertyValue", target = "prpty2Val")
	@Mapping(source ="propertyDesc", target = "prptyDesc")
	@InheritInverseConfiguration
	@Override
	PropertyUI toVo(PortalProperty entity);

}
