package cd.casic.ci.process.process.converter;

import cd.casic.ci.process.dto.req.template.TemplateCreateByDataReq;
import cd.casic.ci.process.dto.req.template.TemplateCreateReq;
import cd.casic.ci.process.dto.req.template.TemplateUpdateReq;
import cd.casic.ci.process.dto.resp.template.TemplateFindResp;
import cd.casic.ci.process.dto.resp.template.TemplateStageResp;
import cd.casic.ci.process.dto.resp.template.TemplateTasksResp;
import cd.casic.ci.process.process.dataObject.stage.PipStage;
import cd.casic.ci.process.process.dataObject.task.PipTask;
import cd.casic.ci.process.process.dataObject.template.TemplateManager;
import cd.casic.ci.process.process.dataObject.template.TemplateStage;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author HopeLi
 * @version v1.0
 * @ClassName PipelineConverter
 * @Date: 2025/5/13 14:39
 * @Description:
 */
@Mapper(componentModel = "spring")
public interface TemplateConverter {
    TemplateConverter INSTANCE = Mappers.getMapper(TemplateConverter.class);
    TemplateFindResp toResp(TemplateManager templateManager);
    List<TemplateFindResp> toRespList(List<TemplateManager> templateManagers);
    PipStage respToStage(TemplateStageResp resp);
    TemplateStageResp stageTemplateToResp(TemplateStage stage);
    PipTask templateTaskToTask(TemplateTasksResp resp);
    TemplateManager managerCreateReqToManager(TemplateCreateReq req);
    TemplateManager managerUpdateReqToManager(TemplateUpdateReq req);

    TemplateManager managerDataToManagerModule(TemplateCreateByDataReq req);
}
