TenantAtlas/apps/platform/database/factories/OperationalControlActivationFactory.php
ahmido d96abc65fb
Some checks failed
Main Confidence / confidence (push) Failing after 1m23s
Remove Findings lifecycle backfill operational surface (controls slice) (#280)
Removes the Findings lifecycle backfill from the Operational Controls UI and OperationalControlCatalog.

This patch is a safe, controls-only change; runbooks, jobs and other runtime artifacts are NOT removed yet. Follow-up work will delete the runbook service/scope, jobs, commands, and update tests.

Files changed:
- apps/platform/app/Filament/System/Pages/Ops/Controls.php
- apps/platform/app/Support/OperationalControls/OperationalControlCatalog.php
- apps/platform/tests/Feature/System/OpsControls/OperationalControlManagementTest.php
- apps/platform/tests/Unit/Support/OperationalControls/OperationalControlCatalogTest.php
- apps/platform/tests/Unit/Support/OperationalControls/OperationalControlScopeResolutionTest.php

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #280
2026-04-26 15:43:47 +00:00

55 lines
1.4 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\OperationalControlActivation;
use App\Models\PlatformUser;
use App\Models\Workspace;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<OperationalControlActivation>
*/
class OperationalControlActivationFactory extends Factory
{
protected $model = OperationalControlActivation::class;
/**
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'control_key' => 'restore.execute',
'scope_type' => 'global',
'workspace_id' => null,
'reason_text' => fake()->sentence(),
'expires_at' => null,
'created_by_platform_user_id' => PlatformUser::factory(),
'updated_by_platform_user_id' => null,
];
}
public function forControl(string $controlKey): static
{
return $this->state(fn (): array => [
'control_key' => $controlKey,
]);
}
public function forGlobalScope(): static
{
return $this->state(fn (): array => [
'scope_type' => 'global',
'workspace_id' => null,
]);
}
public function workspaceScoped(): static
{
return $this->state(fn (): array => [
'scope_type' => 'workspace',
'workspace_id' => Workspace::factory(),
]);
}
}