Don't match wrong company when no temporal match exists
When no company in search results existed at the claimed employment start date, return no match instead of falling back to wrong company. This prevents matching "UK MATTEL LTD" (2025) when the CV claims employment in 2006-2013 and the real "MATTEL U.K. LIMITED" (1980) isn't in the search results. Result: Company shows as "Unverified" instead of wrongly verified with multiple "Employment Before Company Existed" flags. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -617,11 +617,15 @@ public sealed class CompanyVerifierService : ICompanyVerifierService
|
||||
_logger.LogDebug("Selected: {Title} ({Number})", existedAtStartDate[0].Item.Title, existedAtStartDate[0].Item.CompanyNumber);
|
||||
return existedAtStartDate[0];
|
||||
}
|
||||
|
||||
// No companies existed at the claimed start date - don't match a wrong company
|
||||
_logger.LogDebug("No companies found that existed at claimed start date {StartDate}, returning no match", claimedStartDate.Value);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fall back to highest score if no temporal match
|
||||
// No start date provided - just use highest score
|
||||
var fallback = matches.OrderByDescending(m => m.Score).First();
|
||||
_logger.LogDebug("Falling back to highest score: {Title} ({Number})", fallback.Item.Title, fallback.Item.CompanyNumber);
|
||||
_logger.LogDebug("No start date filter, using highest score: {Title} ({Number})", fallback.Item.Title, fallback.Item.CompanyNumber);
|
||||
return fallback;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user