Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace HiEvents\Console;

use HiEvents\Jobs\Account\ProcessScheduledAccountDeletionsJob;
use HiEvents\Jobs\Message\SendScheduledMessagesJob;
use HiEvents\Jobs\Waitlist\ProcessExpiredWaitlistOffersJob;
use Illuminate\Console\Scheduling\Schedule;
Expand All @@ -15,6 +16,7 @@ protected function schedule(Schedule $schedule): void
{
$schedule->job(new SendScheduledMessagesJob)->everyMinute()->withoutOverlapping();
$schedule->job(new ProcessExpiredWaitlistOffersJob)->everyMinute()->withoutOverlapping();
$schedule->job(new ProcessScheduledAccountDeletionsJob)->hourly()->withoutOverlapping();

$schedule->call(function (): void {
$count = DB::table('failed_jobs')->count();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace HiEvents\DomainObjects;

class AccountDeletionRequestDomainObject extends Generated\AccountDeletionRequestDomainObjectAbstract
{
}
12 changes: 12 additions & 0 deletions backend/app/DomainObjects/AccountDomainObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class AccountDomainObject extends Generated\AccountDomainObjectAbstract
{
private ?AccountMessagingTierDomainObject $messagingTier = null;

private ?AccountDeletionRequestDomainObject $activeDeletionRequest = null;

public function getMessagingTier(): ?AccountMessagingTierDomainObject
{
return $this->messagingTier;
Expand All @@ -15,4 +17,14 @@ public function setMessagingTier(AccountMessagingTierDomainObject $messagingTier
{
$this->messagingTier = $messagingTier;
}

public function getActiveDeletionRequest(): ?AccountDeletionRequestDomainObject
{
return $this->activeDeletionRequest;
}

public function setActiveDeletionRequest(?AccountDeletionRequestDomainObject $activeDeletionRequest): void
{
$this->activeDeletionRequest = $activeDeletionRequest;
}
}
11 changes: 11 additions & 0 deletions backend/app/DomainObjects/Enums/AccountDeletionInitiator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace HiEvents\DomainObjects\Enums;

enum AccountDeletionInitiator
{
use BaseEnum;

case ACCOUNT_OWNER;
case ADMIN;
}
11 changes: 11 additions & 0 deletions backend/app/DomainObjects/Enums/AccountDeletionOutcome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace HiEvents\DomainObjects\Enums;

enum AccountDeletionOutcome
{
use BaseEnum;

case HARD_DELETE;
case ANONYMIZE;
}
14 changes: 14 additions & 0 deletions backend/app/DomainObjects/Enums/AnonymizationStrategy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace HiEvents\DomainObjects\Enums;

enum AnonymizationStrategy
{
use BaseEnum;

case NULLIFY;
case SCRUB_TEXT;
case SCRUB_EMAIL;
case SCRUB_EMAIL_UNIQUE;
case RANDOM_TOKEN;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
<?php

namespace HiEvents\DomainObjects\Generated;

/**
* THIS FILE IS AUTOGENERATED - DO NOT EDIT IT DIRECTLY.
* @package HiEvents\DomainObjects\Generated
*/
abstract class AccountDeletionRequestDomainObjectAbstract extends \HiEvents\DomainObjects\AbstractDomainObject
{
final public const SINGULAR_NAME = 'account_deletion_request';
final public const PLURAL_NAME = 'account_deletion_requests';
final public const ID = 'id';
final public const ACCOUNT_ID = 'account_id';
final public const REQUESTED_BY_USER_ID = 'requested_by_user_id';
final public const CANCELLED_BY_USER_ID = 'cancelled_by_user_id';
final public const INITIATED_BY = 'initiated_by';
final public const REASON = 'reason';
final public const STATUS = 'status';
final public const EXPECTED_OUTCOME = 'expected_outcome';
final public const OUTCOME = 'outcome';
final public const SCHEDULED_DELETION_AT = 'scheduled_deletion_at';
final public const REMINDER_SENT_AT = 'reminder_sent_at';
final public const CANCELLED_AT = 'cancelled_at';
final public const COMPLETED_AT = 'completed_at';
final public const DELETION_MANIFEST = 'deletion_manifest';
final public const CREATED_AT = 'created_at';
final public const UPDATED_AT = 'updated_at';

protected int $id;
protected int $account_id;
protected int $requested_by_user_id;
protected ?int $cancelled_by_user_id = null;
protected string $initiated_by;
protected ?string $reason = null;
protected string $status = 'REQUESTED';
protected ?string $expected_outcome = null;
protected ?string $outcome = null;
protected string $scheduled_deletion_at;
protected ?string $reminder_sent_at = null;
protected ?string $cancelled_at = null;
protected ?string $completed_at = null;
protected array|string|null $deletion_manifest = null;
protected ?string $created_at = null;
protected ?string $updated_at = null;

public function toArray(): array
{
return [
'id' => $this->id ?? null,
'account_id' => $this->account_id ?? null,
'requested_by_user_id' => $this->requested_by_user_id ?? null,
'cancelled_by_user_id' => $this->cancelled_by_user_id ?? null,
'initiated_by' => $this->initiated_by ?? null,
'reason' => $this->reason ?? null,
'status' => $this->status ?? null,
'expected_outcome' => $this->expected_outcome ?? null,
'outcome' => $this->outcome ?? null,
'scheduled_deletion_at' => $this->scheduled_deletion_at ?? null,
'reminder_sent_at' => $this->reminder_sent_at ?? null,
'cancelled_at' => $this->cancelled_at ?? null,
'completed_at' => $this->completed_at ?? null,
'deletion_manifest' => $this->deletion_manifest ?? null,
'created_at' => $this->created_at ?? null,
'updated_at' => $this->updated_at ?? null,
];
}

public function setId(int $id): self
{
$this->id = $id;
return $this;
}

public function getId(): int
{
return $this->id;
}

public function setAccountId(int $account_id): self
{
$this->account_id = $account_id;
return $this;
}

public function getAccountId(): int
{
return $this->account_id;
}

public function setRequestedByUserId(int $requested_by_user_id): self
{
$this->requested_by_user_id = $requested_by_user_id;
return $this;
}

public function getRequestedByUserId(): int
{
return $this->requested_by_user_id;
}

public function setCancelledByUserId(?int $cancelled_by_user_id): self
{
$this->cancelled_by_user_id = $cancelled_by_user_id;
return $this;
}

public function getCancelledByUserId(): ?int
{
return $this->cancelled_by_user_id;
}

public function setInitiatedBy(string $initiated_by): self
{
$this->initiated_by = $initiated_by;
return $this;
}

public function getInitiatedBy(): string
{
return $this->initiated_by;
}

public function setReason(?string $reason): self
{
$this->reason = $reason;
return $this;
}

public function getReason(): ?string
{
return $this->reason;
}

public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}

public function getStatus(): string
{
return $this->status;
}

public function setExpectedOutcome(?string $expected_outcome): self
{
$this->expected_outcome = $expected_outcome;
return $this;
}

public function getExpectedOutcome(): ?string
{
return $this->expected_outcome;
}

public function setOutcome(?string $outcome): self
{
$this->outcome = $outcome;
return $this;
}

public function getOutcome(): ?string
{
return $this->outcome;
}

public function setScheduledDeletionAt(string $scheduled_deletion_at): self
{
$this->scheduled_deletion_at = $scheduled_deletion_at;
return $this;
}

public function getScheduledDeletionAt(): string
{
return $this->scheduled_deletion_at;
}

public function setReminderSentAt(?string $reminder_sent_at): self
{
$this->reminder_sent_at = $reminder_sent_at;
return $this;
}

public function getReminderSentAt(): ?string
{
return $this->reminder_sent_at;
}

public function setCancelledAt(?string $cancelled_at): self
{
$this->cancelled_at = $cancelled_at;
return $this;
}

public function getCancelledAt(): ?string
{
return $this->cancelled_at;
}

public function setCompletedAt(?string $completed_at): self
{
$this->completed_at = $completed_at;
return $this;
}

public function getCompletedAt(): ?string
{
return $this->completed_at;
}

public function setDeletionManifest(array|string|null $deletion_manifest): self
{
$this->deletion_manifest = $deletion_manifest;
return $this;
}

public function getDeletionManifest(): array|string|null
{
return $this->deletion_manifest;
}

public function setCreatedAt(?string $created_at): self
{
$this->created_at = $created_at;
return $this;
}

public function getCreatedAt(): ?string
{
return $this->created_at;
}

public function setUpdatedAt(?string $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}

public function getUpdatedAt(): ?string
{
return $this->updated_at;
}
}
14 changes: 14 additions & 0 deletions backend/app/DomainObjects/Status/AccountDeletionRequestStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace HiEvents\DomainObjects\Status;

use HiEvents\DomainObjects\Enums\BaseEnum;

enum AccountDeletionRequestStatus
{
use BaseEnum;

case REQUESTED;
case CANCELLED;
case COMPLETED;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

declare(strict_types=1);

namespace HiEvents\Exceptions;

class AccountDeletionRequestNotFoundException extends BaseException {}
2 changes: 2 additions & 0 deletions backend/app/Helper/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class Url

public const TICKET_LOOKUP = 'app.frontend_urls.ticket_lookup';

public const ACCOUNT_DANGER_ZONE = 'app.frontend_urls.account_danger_zone';

public static function getFrontEndUrlFromConfig(string $key, array $queryParams = []): string
{
$url = config('app.frontend_url').config($key);
Expand Down
Loading
Loading