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

import com.qqchen.deploy.backend.framework.domain.Entity;
import jakarta.persistence.Column;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * Jenkins构建通知记录实体
 * 
 * <p>记录构建通知的发送状态，防止重复通知
 * <p>参考 longi-deployment 的设计：使用双标识防重机制
 *
 * @author qqchen
 * @since 2025-11-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@jakarta.persistence.Entity
@Table(name = "deploy_jenkins_build_notification")
public class JenkinsBuildNotification extends Entity<Long> {

    /**
     * 构建记录ID（关联deploy_jenkins_build）
     */
    @Column(name = "build_id", nullable = false)
    private Long buildId;

    /**
     * 团队ID
     */
    @Column(name = "team_id", nullable = false)
    private Long teamId;

    /**
     * 环境ID
     */
    @Column(name = "environment_id", nullable = false)
    private Long environmentId;

    /**
     * 构建开始是否已通知（0：未通知，1：已通知）
     */
    @Column(name = "build_start_notice", nullable = false)
    private Boolean buildStartNotice = false;

    /**
     * 构建结束是否已通知（0：未通知，1：已通知）
     */
    @Column(name = "build_end_notice", nullable = false)
    private Boolean buildEndNotice = false;
}
