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:
2026-04-10 12:50:25 +02:00
parent 239fe57a11
commit 4b182b449a
20 changed files with 1463 additions and 2 deletions

View File

@@ -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 () {