package com.friday.tooldriver.po.taieoc;

import com.friday.operation.api.keepalive.constant.taieoc.TaieOcConstants;
import com.friday.operation.api.tooldriver.dto.rpa.CodePackageDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class OcProcessCommitPo {
    /**
     * 主键
     */
    private Long id;
    /**
     * 流程名称
     */
    private String processName;
    /**
     * 中控租户信息表主键
     */
    private Long ocTenantId;

    /**
     * 发布类型
     */
    private String uploadType;
    /**
     * 发布版本
     */
    private String uploadVersion;
    /**
     * 文件key
     */
    private String fileKey;
    /**
     * 文件名
     */
    private String fileName;
    /**
     * git提交编号
     */
    private String commitId;
    /**
     * git提交标注
     */
    private String commitComment;


    private Boolean isValid;
    private Date createTime;
    private Date updateTime;
    private String operator;

    public CodePackageDto createCodePackageDto(){
        return CodePackageDto.builder()
                .name(processName)
                .version(uploadVersion)
                .fileType(uploadType)
                .filePath(fileKey)
                .fileName(fileName)
                .key(processName + TaieOcConstants.EN_COLON + uploadVersion)
                .build();
    }

}
