Add audit logging, processing stages, delete functionality, and bug fixes

- Add audit logging system for tracking CV uploads, processing, deletion,
  report views, and PDF exports for billing/reference purposes
- Add processing stage display on dashboard instead of generic "Processing"
- Add delete button for CV checks on dashboard
- Fix duplicate primary key error in CompanyCache (race condition)
- Fix DbContext concurrency in Dashboard (concurrent delete/load operations)
- Fix ProcessCVCheckJob to handle deleted records gracefully
- Fix duplicate flags in verification report by deduplicating on Title+Description
- Remove internal cache notes from verification results
- Add EF migrations for ProcessingStage and AuditLog table

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-20 20:58:12 +01:00
parent 652aa2e612
commit 0eee5473e4
21 changed files with 1559 additions and 123 deletions

View File

@@ -20,6 +20,7 @@ public sealed class ProcessCVCheckJobTests : IDisposable
private readonly Mock<ICompanyVerifierService> _companyVerifierServiceMock;
private readonly Mock<IEducationVerifierService> _educationVerifierServiceMock;
private readonly Mock<ITimelineAnalyserService> _timelineAnalyserServiceMock;
private readonly Mock<IAuditService> _auditServiceMock;
private readonly Mock<ILogger<ProcessCVCheckJob>> _loggerMock;
private readonly ProcessCVCheckJob _sut;
@@ -40,6 +41,7 @@ public sealed class ProcessCVCheckJobTests : IDisposable
_companyVerifierServiceMock = new Mock<ICompanyVerifierService>();
_educationVerifierServiceMock = new Mock<IEducationVerifierService>();
_timelineAnalyserServiceMock = new Mock<ITimelineAnalyserService>();
_auditServiceMock = new Mock<IAuditService>();
_loggerMock = new Mock<ILogger<ProcessCVCheckJob>>();
_sut = new ProcessCVCheckJob(
@@ -49,6 +51,7 @@ public sealed class ProcessCVCheckJobTests : IDisposable
_companyVerifierServiceMock.Object,
_educationVerifierServiceMock.Object,
_timelineAnalyserServiceMock.Object,
_auditServiceMock.Object,
_loggerMock.Object);
}

View File

@@ -23,6 +23,7 @@ public sealed class CVCheckServiceTests : IDisposable
private readonly ApplicationDbContext _dbContext;
private readonly Mock<IFileStorageService> _fileStorageServiceMock;
private readonly Mock<IBackgroundJobClient> _backgroundJobClientMock;
private readonly Mock<IAuditService> _auditServiceMock;
private readonly Mock<ILogger<CVCheckService>> _loggerMock;
private readonly CVCheckService _sut;
@@ -35,12 +36,14 @@ public sealed class CVCheckServiceTests : IDisposable
_dbContext = new ApplicationDbContext(options);
_fileStorageServiceMock = new Mock<IFileStorageService>();
_backgroundJobClientMock = new Mock<IBackgroundJobClient>();
_auditServiceMock = new Mock<IAuditService>();
_loggerMock = new Mock<ILogger<CVCheckService>>();
_sut = new CVCheckService(
_dbContext,
_fileStorageServiceMock.Object,
_backgroundJobClientMock.Object,
_auditServiceMock.Object,
_loggerMock.Object);
}