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

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

/**
 * 团队环境通知配置实体
 * 
 * <p>管理团队在特定环境下的通知配置：
 * <ul>
 *   <li>通知渠道配置</li>
 *   <li>部署通知开关</li>
 *   <li>构建通知开关</li>
 * </ul>
 *
 * @author qqchen
 * @since 2025-11-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@jakarta.persistence.Entity
@Table(name = "deploy_team_environment_notification_config")
@LogicDelete(false)
public class TeamEnvironmentNotificationConfig extends Entity<Long> {

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

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

    /**
     * 通知渠道ID（关联sys_notification_channel）
     */
    @Column(name = "notification_channel_id")
    private Long notificationChannelId;

    /**
     * 是否启用审批前提醒
     */
    @Column(name = "pre_approval_notification_enabled", nullable = false)
    private Boolean preApprovalNotificationEnabled = false;

    /**
     * 审批前提醒模板ID（关联sys_notification_template）
     */
    @Column(name = "pre_approval_notification_template_id")
    private Long preApprovalNotificationTemplateId;

    /**
     * 是否启用构建通知
     */
    @Column(name = "build_notification_enabled", nullable = false)
    private Boolean buildNotificationEnabled = false;

    /**
     * 构建通知模板ID（关联sys_notification_template）
     */
    @Column(name = "build_notification_template_id")
    private Long buildNotificationTemplateId;

    /**
     * 构建失败时是否发送日志文件到企业微信
     */
    @Column(name = "build_failure_file_enabled", nullable = false)
    private Boolean buildFailureFileEnabled = false;
}
