Implement compliance exports and retention overrides
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-02 20:13:45 +01:00
parent 5fd546c428
commit eed7699549
45 changed files with 2319 additions and 40 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Enums\DataExportScope;
use App\Jobs\GenerateDataExport;
use App\Models\DataExport;
use Illuminate\Http\RedirectResponse;
@@ -17,6 +18,7 @@ class ProfileDataExportController extends Controller
abort_unless($user, 403);
$hasRecentExport = $user->dataExports()
->where('scope', DataExportScope::USER->value)
->whereIn('status', [DataExport::STATUS_PENDING, DataExport::STATUS_PROCESSING])
->exists();
@@ -25,6 +27,7 @@ class ProfileDataExportController extends Controller
}
$recentReadyExport = $user->dataExports()
->where('scope', DataExportScope::USER->value)
->where('status', DataExport::STATUS_READY)
->where('created_at', '>=', now()->subDay())
->exists();
@@ -36,6 +39,8 @@ class ProfileDataExportController extends Controller
$export = $user->dataExports()->create([
'tenant_id' => $user->tenant_id,
'status' => DataExport::STATUS_PENDING,
'scope' => DataExportScope::USER->value,
'include_media' => false,
]);
GenerateDataExport::dispatch($export->id);