package org.jeecg.modules.flowpath.convert;

import org.jeecg.modules.flowpath.entity.ItdmFlowPathStep;
import org.jeecg.modules.flowpath.entity.ItdmRunFlowPathStep;
import org.jeecg.modules.flowpath.vo.ItdmRunFlowPathStepVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 敏感词 Convert
 *
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)

public interface FlowPathConvert {

    FlowPathConvert INSTANCE = Mappers.getMapper(FlowPathConvert.class);

    @Mapping(target = "flowPath", source = "step.flowPathId")
    @Mapping(target = "flowPathSetp", source = "step.id")
    @Mapping(target = "name", source = "step.name")
    @Mapping(target = "sort", source = "step.sort")
    @Mapping(target = "saveData", source = "saveData")
    @Mapping(target = "id", ignore = true)
    @Mapping(target = "userIds", source = "step.userIds")
    @Mapping(target = "roleId", source = "step.roleId")
    ItdmRunFlowPathStep to(ItdmFlowPathStep step, String saveData, String runFlowPath);


    ItdmRunFlowPathStepVO to(ItdmRunFlowPathStep step, Boolean isUpdate);
}
