Implements spec `099-alerts-v1-teams-email`. - Monitoring navigation: Alerts as a cluster under Monitoring; default landing is Alert deliveries. - Tenant panel: Alerts points to `/admin/alerts` and the cluster navigation is hidden in tenant panel. - Guard compliance: removes direct `Gate::` usage from Alert resources so `NoAdHocFilamentAuthPatternsTest` passes. Verification: - Full suite: `1348 passed, 7 skipped` (EXIT=0). Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #121
34 lines
897 B
PHP
34 lines
897 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\AlertRule;
|
|
use App\Models\Workspace;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<AlertRule>
|
|
*/
|
|
class AlertRuleFactory extends Factory
|
|
{
|
|
protected $model = AlertRule::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'workspace_id' => Workspace::factory(),
|
|
'name' => 'Rule '.fake()->unique()->word(),
|
|
'is_enabled' => true,
|
|
'event_type' => AlertRule::EVENT_HIGH_DRIFT,
|
|
'minimum_severity' => 'high',
|
|
'tenant_scope_mode' => AlertRule::TENANT_SCOPE_ALL,
|
|
'tenant_allowlist' => [],
|
|
'cooldown_seconds' => 900,
|
|
'quiet_hours_enabled' => false,
|
|
'quiet_hours_start' => null,
|
|
'quiet_hours_end' => null,
|
|
'quiet_hours_timezone' => null,
|
|
];
|
|
}
|
|
}
|