Feature: Creating Privacy Basics
This commit is contained in:
@@ -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
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user