feat: complete person identity matching system with fuzzy detection, revert, and manual link

Implements the full identity matching engine: email matching (HIGH confidence),
fuzzy name matching with Levenshtein distance (MEDIUM confidence, upgradable to
HIGH with DOB tiebreaker), manual link/unlink, revert confirmed matches, and
automatic detection via PersonObserver. Includes 33 comprehensive tests, frontend
integration with confirm/dismiss/unlink UI, and match indicators in the persons list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-14 08:44:24 +02:00
parent 7932e53daf
commit eb1a0ac666
30 changed files with 1941 additions and 399 deletions

View File

@@ -6,6 +6,14 @@ namespace App\Enums;
enum IdentityMatchConfidence: string
{
case EXACT = 'exact';
case FUZZY = 'fuzzy';
case HIGH = 'high';
case MEDIUM = 'medium';
public function label(): string
{
return match ($this) {
self::HIGH => 'Hoge zekerheid',
self::MEDIUM => 'Gemiddelde zekerheid',
};
}
}

View File

@@ -7,6 +7,15 @@ namespace App\Enums;
enum IdentityMatchMethod: string
{
case EMAIL = 'email';
case PHONE = 'phone';
case NAME_FUZZY = 'name_fuzzy';
case MANUAL = 'manual';
public function label(): string
{
return match ($this) {
self::EMAIL => 'E-mail match',
self::NAME_FUZZY => 'Naam match (vergelijkbaar)',
self::MANUAL => 'Handmatig gekoppeld',
};
}
}

View File

@@ -9,4 +9,20 @@ enum IdentityMatchStatus: string
case PENDING = 'pending';
case CONFIRMED = 'confirmed';
case DISMISSED = 'dismissed';
case REVERTED = 'reverted';
public function isTerminal(): bool
{
return in_array($this, [self::DISMISSED, self::REVERTED]);
}
public function label(): string
{
return match ($this) {
self::PENDING => 'In afwachting',
self::CONFIRMED => 'Bevestigd',
self::DISMISSED => 'Afgewezen',
self::REVERTED => 'Ontkoppeld',
};
}
}