package com.friday.operation.api.tooldriver.dto.rpa;

import com.friday.operation.api.tooldriver.constant.ProcessTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Author YaoYao
 * @Date Created In 11:28 2022/12/1
 * @Description 发布流程数据结构
 * @Modified By
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ProgramProcessReleaseDto implements Serializable {
    /**
     * 流程发布键值
     */
    private Integer releaseKey;
    /**
     * 中控租户键值
     */
    private Integer ocTenantKey;
    /**
     * 中控组键值
     */
    private Integer programGroupKey;
    /**
     * 流程名称
     */
    private String processName;
    /**
     * 流程版本
     */
    private String processVersion;
    /**
     * 流程代码包路径
     */
    private String processFileKey;
    /**
     * 流程发布名称
     */
    private String releaseName;
    /**
     * 流程发布类型{@link ProcessTypeEnum}
     */
    private String processType;

    public ReleaseDto transferToReleaseDto(){
        return ReleaseDto.builder()
                .key(String.valueOf(releaseKey))
                .name(processName)
                .processVersion(processVersion)
                .codePackageName(processName)
                .build();
    }

}
