From 5f5ce7b4b122abab78b9ca39a005fa95d39bb9fe Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 22 Jun 2026 21:24:58 +0200 Subject: [PATCH] Add missing files --- .../Commands/GdprPurgeExpiredExports.php | 24 +++++++++ app/Models/GdprConsent.php | 54 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 app/Console/Commands/GdprPurgeExpiredExports.php create mode 100644 app/Models/GdprConsent.php diff --git a/app/Console/Commands/GdprPurgeExpiredExports.php b/app/Console/Commands/GdprPurgeExpiredExports.php new file mode 100644 index 000000000..d47720364 --- /dev/null +++ b/app/Console/Commands/GdprPurgeExpiredExports.php @@ -0,0 +1,24 @@ +purgeExpiredExports(); + + $this->info("Purged {$count} expired GDPR export file(s)."); + + return self::SUCCESS; + } +} diff --git a/app/Models/GdprConsent.php b/app/Models/GdprConsent.php new file mode 100644 index 000000000..88ca3a8c4 --- /dev/null +++ b/app/Models/GdprConsent.php @@ -0,0 +1,54 @@ + + */ + protected $fillable = [ + 'user_id', + 'consent_type', + 'status', + 'policy_version', + 'consented_at', + 'withdrawn_at', + 'ip_address', + 'user_agent_hash', + 'metadata', + ]; + + /** + * @return array + */ + protected function casts(): array + { + return [ + 'consented_at' => 'datetime', + 'withdrawn_at' => 'datetime', + 'metadata' => 'array', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + ]; + } + + /** + * @return BelongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } +}