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

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

import java.time.LocalDateTime;

/**
 * 仓库分支DTO
 *
 * @author QQchen
 * @version 1.0
 */
@Data
@Schema(description = "仓库分支DTO")
@EqualsAndHashCode(callSuper = true)
public class RepositoryBranchDTO extends BaseDTO {
    
    @Schema(description = "外部系统ID")
    @NotNull(message = "外部系统ID不能为空")
    private Long externalSystemId;
    
    @Schema(description = "所属项目ID")
    @NotNull(message = "项目ID不能为空")
    private Long projectId;
    
    @Schema(description = "分支名称")
    @NotBlank(message = "分支名称不能为空")
    private String name;
    
    @Schema(description = "是否为默认分支")
    private Boolean isDefaultBranch = false;
    
    @Schema(description = "是否受保护")
    private Boolean isProtected = false;
    
    @Schema(description = "是否可推送")
    private Boolean canPush = true;
    
    @Schema(description = "开发者是否可推送")
    private Boolean developersCanPush = true;
    
    @Schema(description = "开发者是否可合并")
    private Boolean developersCanMerge = true;
    
    @Schema(description = "最新提交ID")
    private String commitId;
    
    @Schema(description = "最新提交信息")
    private String commitMessage;
    
    @Schema(description = "最新提交作者")
    private String commitAuthor;
    
    @Schema(description = "最新提交时间")
    private LocalDateTime commitDate;
    
    @Schema(description = "网页URL")
    private String webUrl;
} 