mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Add missing files
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user