package com.eactive.eai.rms.common.scheduler.ui;

import org.mapstruct.BeanMapping;
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.mapper.GenericMapper;
import com.eactive.eai.rms.data.entity.man.scheduler.JobInfo;

@Mapper(componentModel = "spring", uses = { JobDataMapper.class }, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface JobInfoMapper extends GenericMapper<JobInfoUI, com.eactive.eai.rms.data.entity.man.scheduler.JobInfo> {

	@Override
	JobInfoUI toVo(JobInfo entity);

	@Mapping(target = "jobDatas", ignore = true)
   @Mapping(target = "scheduleInfo", ignore = true)
   @Mapping(target = "clusteredScheduleInfo", ignore = true)
	JobInfoUI toVoWithoutChild(JobInfo entity);

	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateEntity(JobInfoUI jobInfoUI, @MappingTarget JobInfo jobInfo);
}
