package cd.casic.ci.process.process.service.template;

import cd.casic.ci.process.dto.req.stage.StageCreateReq;
import cd.casic.ci.process.dto.req.stage.StageUpdateReq;
import cd.casic.ci.process.dto.req.template.TemplateStageCreateReq;
import cd.casic.ci.process.dto.req.template.TemplateStageUpdateReq;
import cd.casic.ci.process.dto.resp.stage.StageResp;
import cd.casic.ci.process.dto.resp.template.TemplateStageResp;
import cd.casic.ci.process.process.dataObject.stage.PipStage;
import cd.casic.ci.process.process.dataObject.template.TemplateStage;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.validation.constraints.NotEmpty;

import java.util.List;

public interface TemplateStageService extends IService<TemplateStage> {
    /**
     * 创建阶段及关联任务
     * @param stage 阶段信息
     * @return 阶段id
     */
    String createStagesOrTask(TemplateStageCreateReq stage);


    /**
     * 查询所有阶段任务
     * @param templateId 流水线id
     * @return 任务
     */
    List<TemplateStageResp> findAllStagesTask(String templateId);
    List<TemplateStage> findAllFirstStagesAndChild(String templateId);



    void deleteFirstStage(String stageId);
    /**
     * 删除阶段及任务
     * @param taskId 配置id
     */
    void deleteStagesAndTask(String taskId);

    public void updateStagesTask(TemplateStageUpdateReq stage);

    public void copyStage(String stageId);
}
