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,
|
|
];
|
|
}
|
|
}
|