Разбить Infrastructure и корень Deal.Api по назначению

Integrations -> Abstractions/Exceptions/Extensions/Models/Options/
Services (включая Storage); Persistence-конфигурации -> Configurations;
корень Deal.Api (оркестратор/планировщики/DTO) -> Services/Dtos.
namespace приведён к путям, using добавлены/дедуплицированы, FQN
обновлены.
This commit is contained in:
Rustam Khalimov
2026-09-11 13:20:10 +03:00
parent cd0b3b606b
commit 410194b0cb
289 changed files with 855 additions and 101 deletions
@@ -0,0 +1,38 @@
using Deal.Infrastructure.Persistence.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Deal.Infrastructure.Persistence;
using Deal.Infrastructure.Persistence.Configurations;
namespace Deal.Infrastructure.Persistence.Configurations;
/// <summary>
/// EF-конфигурация отсева пайплайна: таблица RejectedItems (модель без схемы).
/// </summary>
/// <remarks>
/// Без внешних ключей — отсев живёт дольше карточки. Тексты Text/Reason/Kw — text (лимиты 6000/500/200
/// символов применяет сервис). SearchTsv — вычисляемая STORED-колонка tsvector (Ruling 6).
/// </remarks>
public sealed class RejectedItemConfiguration : IEntityTypeConfiguration<RejectedItemEntity>
{
public void Configure(EntityTypeBuilder<RejectedItemEntity> builder)
{
builder.ToTable("RejectedItems");
builder.HasKey(x => x.Id);
builder.Property(x => x.Text).HasColumnType("text");
builder.Property(x => x.Reason).HasColumnType("text");
builder.Property(x => x.Kw).HasColumnType("text");
// Полнотекстовый вектор отсева: только Text (fts.py _FTS_TARGETS) — поиск GET /pipeline/rejected?q=.
builder.Property(x => x.SearchTsv)
.HasComputedColumnSql("to_tsvector('russian', coalesce(\"Text\",''))", stored: true);
// Автоочистка старше 3 суток и сортировка списка идут по времени отсева.
builder.HasIndex(x => x.RejectedAt);
// Полнотекстовый поиск отсева — GIN-индекс по tsvector (Ruling 6).
builder.HasIndex(x => x.SearchTsv).HasMethod("gin");
}
}