Feature: Creating Privacy Basics

This commit is contained in:
2026-08-24 21:06:11 +03:00
parent e31de1b4e3
commit 9f540cbaa4
38 changed files with 1969 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Modules\Core\Privacy;
/**
* Every registered provider's outcome, assembled into one right-of-erasure response
* — the audit trail proving what happened and, for anything not fully erased, why.
* $subject is whichever scope the request was for — see docs/privacy.md
* "User-scope vs Customer-scope".
*/
class ErasureReport
{
/**
* @param array<int, ProviderErasureResult> $results
*/
public function __construct(
public readonly UserSubject|CustomerSubject $subject,
public readonly array $results,
) {}
/**
* @return array<int, ProviderErasureResult>
*/
public function retained(): array
{
return array_values(array_filter(
$this->results,
fn (ProviderErasureResult $result) => $result->outcome === ErasureOutcome::Retained
));
}
}