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

import com.qqchen.deploy.backend.deploy.enums.ExternalSystemSyncStatus;
import com.qqchen.deploy.backend.deploy.enums.JenkinsSyncType;
import com.qqchen.deploy.backend.framework.annotation.LogicDelete;
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;

@Data
@EqualsAndHashCode(callSuper = true)
@jakarta.persistence.Entity
@Table(name = "deploy_jenkins_sync_history")
@LogicDelete
public class JenkinsSyncHistory extends Entity<Long> {

    @Column(name = "sync_history_number", nullable = false)
    private String number;

    @Column(name = "sync_type", nullable = false)
    @Enumerated(EnumType.STRING)
    private JenkinsSyncType syncType;

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

    @Column(name = "start_time", nullable = false)
    private LocalDateTime startTime;

    @Column(name = "end_time")
    private LocalDateTime endTime;

    @Column(name = "error_message", columnDefinition = "TEXT")
    private String errorMessage;

    @Column(name = "external_system_id", nullable = false)
    private Long externalSystemId;

}