@page "/report/{Id:guid}" @attribute [Authorize] @rendermode InteractiveServer @inject ICVCheckService CVCheckService @inject NavigationManager NavigationManager @inject AuthenticationStateProvider AuthenticationStateProvider @inject ILogger Logger Verification Report - TrueCV
@if (_isLoading) {
Loading...

Loading report...

} else if (_errorMessage is not null) { Back to Dashboard } else if (_check is not null && _check.Status != "Completed") {
@if (_check.Status == "Processing") {
Processing...

Processing Your CV

Our AI is analyzing the document. This usually takes 1-2 minutes.

} else if (_check.Status == "Pending") {

Queued for Processing

Your CV is in the queue and will be processed shortly.

} else if (_check.Status == "Failed") {

Processing Failed

We encountered an error processing your CV. Please try uploading again.

}

File: @_check.OriginalFileName
Uploaded: @_check.CreatedAt.ToString("dd MMM yyyy HH:mm")

} else if (_report is not null && _check is not null) {

Verification Report

@_check.OriginalFileName | Generated @_report.GeneratedAt.ToString("dd MMM yyyy HH:mm")

@_report.OverallScore
@_report.ScoreLabel
Veracity Score

@_report.EmploymentVerifications.Count

Employers Checked

@_report.TimelineAnalysis.TotalGapMonths

Months of Gaps

@_report.Flags.Count

Flags Raised
Employment Verification
@foreach (var verification in _report.EmploymentVerifications) { @if (!string.IsNullOrEmpty(verification.VerificationNotes)) { } }
Claimed Employer Period Matched Company Match Score Status
@verification.ClaimedCompany @if (verification.ClaimedStartDate.HasValue) { @verification.ClaimedStartDate.Value.ToString("MMM yyyy") - @if (verification.ClaimedEndDate.HasValue) { @verification.ClaimedEndDate.Value.ToString("MMM yyyy") } else { Present } } else { Not specified } @if (!string.IsNullOrEmpty(verification.MatchedCompanyName)) { @verification.MatchedCompanyName @if (!string.IsNullOrEmpty(verification.MatchedCompanyNumber)) {
@verification.MatchedCompanyNumber } } else { No match found }
@verification.MatchScore% @if (verification.IsVerified) { Verified } else { Unverified }
@verification.VerificationNotes
Employment Gaps
@if (_report.TimelineAnalysis.Gaps.Count > 0) {
    @foreach (var gap in _report.TimelineAnalysis.Gaps) {
  • @gap.StartDate.ToString("MMM yyyy") - @gap.EndDate.ToString("MMM yyyy") @gap.Months months
  • }
Total gap time: @_report.TimelineAnalysis.TotalGapMonths months
} else {

No significant gaps detected

}
Timeline Overlaps
@if (_report.TimelineAnalysis.Overlaps.Count > 0) {
    @foreach (var overlap in _report.TimelineAnalysis.Overlaps) {
  • @overlap.Company1 & @overlap.Company2
    @overlap.Months months
    @overlap.OverlapStart.ToString("MMM yyyy") - @overlap.OverlapEnd.ToString("MMM yyyy")
  • }
Total overlap time: @_report.TimelineAnalysis.TotalOverlapMonths months
} else {

No overlapping positions detected

}
@if (_report.Flags.Count > 0) {
Flags Raised
@{ var criticalFlags = _report.Flags.Where(f => f.Severity == "Critical").ToList(); var warningFlags = _report.Flags.Where(f => f.Severity == "Warning").ToList(); var infoFlags = _report.Flags.Where(f => f.Severity == "Info").ToList(); } @if (criticalFlags.Count > 0) {
Critical Issues
@foreach (var flag in criticalFlags) {
@flag.Title -@flag.ScoreImpact pts

@flag.Description

} } @if (warningFlags.Count > 0) {
Warnings
@foreach (var flag in warningFlags) {
@flag.Title -@flag.ScoreImpact pts

@flag.Description

} } @if (infoFlags.Count > 0) {
Information
@foreach (var flag in infoFlags) {
@flag.Title -@flag.ScoreImpact pts

@flag.Description

} }
} }
@code { [Parameter] public Guid Id { get; set; } private CVCheckDto? _check; private VeracityReport? _report; private bool _isLoading = true; private string? _errorMessage; private Guid _userId; protected override async Task OnInitializedAsync() { await LoadData(); } private async Task LoadData() { _isLoading = true; _errorMessage = null; try { var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); var userIdClaim = authState.User.FindFirst(ClaimTypes.NameIdentifier)?.Value; if (string.IsNullOrEmpty(userIdClaim) || !Guid.TryParse(userIdClaim, out _userId)) { _errorMessage = "Unable to identify user. Please log in again."; return; } _check = await CVCheckService.GetCheckForUserAsync(Id, _userId); if (_check is null) { _errorMessage = "Report not found or you don't have access to view it."; return; } if (_check.Status == "Completed") { _report = await CVCheckService.GetReportAsync(Id, _userId); if (_report is null) { _errorMessage = "Unable to load the report data."; } } } catch (Exception ex) { Logger.LogError(ex, "Error loading report data"); _errorMessage = "An error occurred while loading the report. Please try again."; } finally { _isLoading = false; } } private async Task RefreshStatus() { await LoadData(); } private void DownloadReport() { // TODO: Implement report download functionality } private static string GetScoreColorClass(int score) { return score switch { > 70 => "score-high", >= 50 => "score-medium", _ => "score-low" }; } private static string GetMatchScoreBadgeClass(int score) { return score switch { >= 80 => "bg-success", >= 50 => "bg-warning text-dark", _ => "bg-danger" }; } }