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

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.lifecycle.LifeCycle;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface LifecycleUIMapper extends GenericMapper<LifecycleUI, LifeCycle> {

	@Override
	@Mapping(source = "lifecyclclsname", target = "lifeCyclClsName")
	@Mapping(source = "lodinseq", target = "lodinSeq")
	@Mapping(source = "lifecyclusedstcd", target = "lifeCyclUseDstcd")
	LifecycleUI toVo(LifeCycle entity);

	@Override
	@InheritInverseConfiguration
	LifeCycle toEntity(LifecycleUI vo);

	@InheritInverseConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateToEntity(LifecycleUI lifeCycleVO, @MappingTarget LifeCycle lifeCycle);

}
