package com.eactive.eai.rms.onl.manage.comm.code;

import org.mapstruct.BeanMapping;
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.entity.onl.errorcode.ErrorCode;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ErrorCodeMapper extends GenericMapper<ErrorCodeUI, ErrorCode> {

	@Override
	@Mapping(source = "msgctnt", target = "msgCtnt")
	@Mapping(source = "treatmatrctnt", target = "treatMatrCtnt")
	ErrorCodeUI toVo(ErrorCode entity);

	@Override
	@InheritInverseConfiguration
	ErrorCode toEntity(ErrorCodeUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(ErrorCodeUI errorCodVo, @MappingTarget ErrorCode errorCode);

}
