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

import com.qqchen.deploy.backend.deploy.enums.BuildTypeEnum;
import com.qqchen.deploy.backend.framework.dto.BaseDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "团队应用关联信息")
public class TeamApplicationDTO extends BaseDTO {

    @Schema(description = "团队ID", required = true)
    @NotNull(message = "团队ID不能为空")
    private Long teamId;

    @Schema(description = "应用ID", required = true)
    @NotNull(message = "应用ID不能为空")
    private Long applicationId;

    @Schema(description = "环境ID", required = true)
    @NotNull(message = "环境ID不能为空")
    private Long environmentId;

    @Schema(description = "构建类型", example = "JENKINS")
    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 = "工作流定义名称")
    private String workflowDefinitionName;

    // ==================== 关联信息 ====================

    @Schema(description = "团队名称")
    private String teamName;

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

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

    @Schema(description = "环境名称")
    private String environmentName;
}

