Feat: Privacy Concern redesign to match project structure
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Privacy\DTOs;
|
||||
|
||||
use Lunar\Models\Customer;
|
||||
|
||||
/**
|
||||
* Identifies "the business account" for a Customer-scoped data-subject request —
|
||||
* erasing/exporting a Customer's own data (orders, addresses, the account record
|
||||
* itself). Deliberately carries no userIds/email: Customer-scope must never touch
|
||||
* any linked User's login or personal identity, only the account's own data — see
|
||||
* docs/privacy.md "User-scope vs Customer-scope". A provider that needs to know
|
||||
* which Users are linked (e.g. to export their names as account contacts, without
|
||||
* erasing their logins) looks that up itself via the Customer model, rather than
|
||||
* this value object handing it out — keeping "erase a Customer" structurally
|
||||
* incapable of touching a User row is the whole point of the split.
|
||||
*/
|
||||
class CustomerSubject
|
||||
{
|
||||
public function __construct(
|
||||
public readonly int $customerId,
|
||||
) {}
|
||||
|
||||
public static function forCustomer(Customer $customer): self
|
||||
{
|
||||
return new self(customerId: $customer->id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user