feat: cli command to anonymize local database

This commit is contained in:
Björn Fromme
2026-06-17 10:32:02 +02:00
parent 66d0f511df
commit 80569e0977
7 changed files with 786 additions and 0 deletions
+14
View File
@@ -164,6 +164,20 @@ class BookingEditDraft
return $this;
}
/**
* Replaces the form data without touching timestamps.
*
* Used by anonymization tooling that must not alter audit dates.
*
* @param array<string, mixed> $formData
*/
public function replaceFormData(array $formData): static
{
$this->formData = $formData;
return $this;
}
public function getCreatedAt(): \DateTimeImmutable
{
return $this->createdAt;
+15
View File
@@ -65,6 +65,11 @@ class NewsletterConsent
return $this->email;
}
public function setEmail(string $email): void
{
$this->email = mb_strtolower(trim($email));
}
public function getMailjetListId(): int
{
return $this->mailjetListId;
@@ -90,6 +95,16 @@ class NewsletterConsent
return $this->lastName;
}
public function getCreatedAt(): \DateTimeImmutable
{
return $this->createdAt;
}
public function getUpdatedAt(): \DateTimeImmutable
{
return $this->updatedAt;
}
public function isConfirmed(): bool
{
return null !== $this->confirmedAt && null === $this->revokedAt;
+5
View File
@@ -76,6 +76,11 @@ class NewsletterOptInRequest
return $this->email;
}
public function setEmail(string $email): void
{
$this->email = mb_strtolower(trim($email));
}
public function getTokenHash(): string
{
return $this->tokenHash;