package com.eactive.eai.transformer.function.mapper;

import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

import com.eactive.eai.data.entity.onl.transformer.function.Parameter;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.transformer.function.ParameterDefinition;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ParameterMapper extends GenericMapper<ParameterDefinition, Parameter> {

	@Mapping(source = "id.cnvsnfuntnname", target = "functionName")
	@Mapping(source = "id.cnvsnfuntnparmname", target = "name")
	@Mapping(source = "cnvsnfuntnparmdesc", target = "description")
	@Mapping(source = "cnvsnfuntnparmptrnidname", target = "typeId")
	@Mapping(source = "cnvsnfuntnparmserno", target = "seqNo")
	@Override
	ParameterDefinition toVo(Parameter entity);

	@InheritInverseConfiguration
	@Override
	Parameter toEntity(ParameterDefinition vo);

}
