package com.qqchen.deploy.backend.deploy.dto;

import com.qqchen.deploy.backend.deploy.enums.BuildTypeEnum;
import com.qqchen.deploy.backend.deploy.enums.DevelopmentLanguageTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 用户可部署团队环境应用DTO
 *
 * @author qqchen
 * @since 2025-11-06
 */
@Data
@Schema(description = "可部署应用信息")
public class UserDeployableTeamEnvironmentApplicationDTO {

    @Schema(description = "团队应用关联ID")
    private Long teamApplicationId;

    @Schema(description = "应用ID")
    private Long applicationId;

    @Schema(description = "应用编码")
    private String applicationCode;

    @Schema(description = "应用名称")
    private String applicationName;

    @Schema(description = "应用描述")
    private String applicationDesc;

    @Schema(description = "开发语言类型")
    private DevelopmentLanguageTypeEnum language;

    @Schema(description = "构建类型（JENKINS-Jenkins构建，NATIVE-脚本部署）")
    private BuildTypeEnum buildType;

    // ==================== 源Git配置（公司内部Git） ====================
    
    @Schema(description = "源Git系统ID（公司Git）")
    private Long sourceGitSystemId;

    @Schema(description = "源Git系统名称")
    private String sourceGitSystemName;

    @Schema(description = "源Git项目ID（公司Git项目ID）")
    private Long sourceGitProjectId;

    @Schema(description = "源Git项目名称")
    private String sourceGitProjectName;

    @Schema(description = "源分支名称（公司Git分支）", example = "develop")
    private String sourceBranch;

    // ==================== 目标Git配置（客户环境Git） ====================
    
    @Schema(description = "目标Git系统ID（客户环境Git）")
    private Long targetGitSystemId;

    @Schema(description = "目标Git系统名称")
    private String targetGitSystemName;

    @Schema(description = "目标Git项目ID（客户环境Git项目）")
    private Long targetGitProjectId;

    @Schema(description = "目标Git项目名称")
    private String targetGitProjectName;

    @Schema(description = "目标分支名称（客户环境分支）")
    private String targetBranch;

    // ==================== 部署配置 ====================
    
    @Schema(description = "部署系统ID（Jenkins系统）")
    private Long deploySystemId;

    @Schema(description = "部署系统名称")
    private String deploySystemName;

    @Schema(description = "部署任务名称（Jenkins Job）")
    private String deployJob;

    // ==================== 工作流配置 ====================

    @Schema(description = "工作流定义ID")
    private Long workflowDefinitionId;

    @Schema(description = "工作流绑定的FORM表单ID")
    private Long workflowDefinitionFormId;

    @Schema(description = "工作流定义名称")
    private String workflowDefinitionName;

    @Schema(description = "工作流流程标识（processKey）")
    private String workflowDefinitionKey;

    @Schema(description = "部署统计信息")
    private DeployStatisticsDTO deployStatistics;

    @Schema(description = "是否正在部署中")
    private Boolean isDeploying;

    @Schema(description = "最近部署记录列表（最多10条）")
    private List<DeployRecordSummaryDTO> recentDeployRecords;
}
