feat: person identity matching with detection, confirmation and audit trail
Implements enterprise-grade identity resolution (detect → suggest → confirm) for Person ↔ User linking. Matches are detected automatically on person creation and user account creation, then surfaced to organisers for explicit confirmation or dismissal. No silent auto-linking. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,23 @@ final class PersonResource extends JsonResource
|
||||
'created_at' => $this->created_at->toIso8601String(),
|
||||
'crowd_type' => new CrowdTypeResource($this->whenLoaded('crowdType')),
|
||||
'company' => new CompanyResource($this->whenLoaded('company')),
|
||||
'pending_identity_match' => $this->when(
|
||||
$this->relationLoaded('pendingIdentityMatch') && $this->pendingIdentityMatch,
|
||||
function () {
|
||||
$match = $this->pendingIdentityMatch;
|
||||
|
||||
return [
|
||||
'match_id' => $match->id,
|
||||
'matched_user' => [
|
||||
'id' => $match->matchedUser->id,
|
||||
'name' => $match->matchedUser->name,
|
||||
'email' => $match->matchedUser->email,
|
||||
],
|
||||
'matched_on' => $match->matched_on->value,
|
||||
'confidence' => $match->confidence->value,
|
||||
];
|
||||
}
|
||||
),
|
||||
'tags' => $this->when(
|
||||
$this->user_id && $this->relationLoaded('user'),
|
||||
function () {
|
||||
|
||||
Reference in New Issue
Block a user