Add missing files

This commit is contained in:
DariusIII
2026-06-22 21:24:58 +02:00
parent 87b0a9d7a6
commit 5f5ce7b4b1
2 changed files with 78 additions and 0 deletions
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace App\Console\Commands;
use App\Services\Gdpr\GdprRetentionService;
use Illuminate\Console\Command;
class GdprPurgeExpiredExports extends Command
{
protected $signature = 'gdpr:purge-expired-exports';
protected $description = 'Purge expired GDPR export files while retaining the request audit record.';
public function handle(GdprRetentionService $retentionService): int
{
$count = $retentionService->purgeExpiredExports();
$this->info("Purged {$count} expired GDPR export file(s).");
return self::SUCCESS;
}
}
+54
View File
@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class GdprConsent extends Model
{
public const TYPE_ESSENTIAL_COOKIES = 'essential_cookies';
public const STATUS_GRANTED = 'granted';
public const STATUS_WITHDRAWN = 'withdrawn';
/**
* @var list<string>
*/
protected $fillable = [
'user_id',
'consent_type',
'status',
'policy_version',
'consented_at',
'withdrawn_at',
'ip_address',
'user_agent_hash',
'metadata',
];
/**
* @return array<string, string>
*/
protected function casts(): array
{
return [
'consented_at' => 'datetime',
'withdrawn_at' => 'datetime',
'metadata' => 'array',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
}
/**
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}