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); + } +}