feat(news): add scraper adapters, article deduplication, blocklist service, and remove tracked publish artifacts

This commit is contained in:
2026-08-24 21:35:33 +02:00
parent 44b161d509
commit 8112598602
400 changed files with 1812 additions and 113367 deletions
+14 -3
View File
@@ -41,9 +41,9 @@ public class NewsDbContext : DbContext, ISettingsDbContext
public DbSet<MatchedAssetEntity> MatchedAssets => Set<MatchedAssetEntity>();
/// <summary>
/// Gets or sets the database set for microservice configuration settings.
/// Gets or sets the database set for blocked news URLs (unindexable or duplicate articles).
/// </summary>
public DbSet<NewsSettingsEntity> Settings => Set<NewsSettingsEntity>();
public DbSet<BlockedNewsUrlEntity> BlockedNewsUrls => Set<BlockedNewsUrlEntity>();
/// <summary>
/// Configures the model mapping, database constraints, and unique indices.
@@ -64,16 +64,27 @@ public class NewsDbContext : DbContext, ISettingsDbContext
.HasIndex(a => a.SourceUrl)
.IsUnique();
// Performance indexes for news queries
// Performance & deduplication indexes for news queries
modelBuilder.Entity<NewsArticleEntity>()
.HasIndex(a => new { a.PublishedAt, a.ScrapedAt });
modelBuilder.Entity<NewsArticleEntity>()
.HasIndex(a => a.Status);
modelBuilder.Entity<NewsArticleEntity>()
.HasIndex(a => a.TitleHash);
modelBuilder.Entity<NewsArticleEntity>()
.HasIndex(a => a.SimHash);
modelBuilder.Entity<MatchedAssetEntity>()
.HasIndex(m => m.Isin);
// Blocked URLs index
modelBuilder.Entity<BlockedNewsUrlEntity>()
.HasIndex(b => b.Url)
.IsUnique();
// Configure relationship between NewsArticle and MatchedAssets
modelBuilder.Entity<MatchedAssetEntity>()
.HasOne(m => m.NewsArticle)