using TakeoutSaaS.Domain.Analytics.Enums;
using TakeoutSaaS.Shared.Abstractions.Entities;

namespace TakeoutSaaS.Domain.Analytics.Entities;

/// <summary>
/// 指标告警规则。
/// </summary>
public sealed class MetricAlertRule : MultiTenantEntityBase
{
    /// <summary>
    /// 关联指标。
    /// </summary>
    public long MetricDefinitionId { get; set; }

    /// <summary>
    /// 触发条件 JSON。
    /// </summary>
    public string ConditionJson { get; set; } = string.Empty;

    /// <summary>
    /// 告警级别。
    /// </summary>
    public MetricAlertSeverity Severity { get; set; } = MetricAlertSeverity.Warning;

    /// <summary>
    /// 通知渠道。
    /// </summary>
    public string NotificationChannels { get; set; } = "email";

    /// <summary>
    /// 是否启用。
    /// </summary>
    public bool Enabled { get; set; } = true;
}
