package com.qqchen.deploy.backend.deploy.entity;

import com.qqchen.deploy.backend.deploy.enums.ExternalSystemSyncStatus;
import com.qqchen.deploy.backend.deploy.enums.RepositorySyncType;
import com.qqchen.deploy.backend.framework.domain.Entity;
import jakarta.persistence.Column;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * Git同步历史记录
 */
@Data
@EqualsAndHashCode(callSuper = true)
@jakarta.persistence.Entity
@Table(name = "deploy_repo_sync_history")
public class RepositorySyncHistory extends Entity<Long> {

    @Column(nullable = false)
    private String number;

    @Column(nullable = false)
    private LocalDateTime startTime;

    @Column
    private LocalDateTime endTime;

    @Column
    private String errorMessage;

    @Column(nullable = false)
    @Enumerated(EnumType.STRING)
    private ExternalSystemSyncStatus status;

    @Column(nullable = false)
    @Enumerated(EnumType.STRING)
    private RepositorySyncType syncType;

    @Column(nullable = false)
    private Long externalSystemId;
} 