Разбить 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,36 @@
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-конфигурация сессии: таблица sessions в схеме public.
/// </summary>
public sealed class SessionConfiguration : IEntityTypeConfiguration<SessionEntity>
{
private const int TokenHashMaxLength = 64;
private const int LoginMaxLength = 200;
public void Configure(EntityTypeBuilder<SessionEntity> builder)
{
builder.ToTable("sessions", "public");
builder.HasKey(x => x.TokenHash);
builder.Property(x => x.TokenHash).HasMaxLength(TokenHashMaxLength);
builder.Property(x => x.Login).HasMaxLength(LoginMaxLength).IsRequired();
builder.Property(x => x.ExpiresAt).IsRequired();
builder.Property(x => x.CreatedAt).IsRequired();
builder.HasIndex(x => x.UserId);
builder.HasIndex(x => x.ExpiresAt);
builder.HasOne<UserEntity>()
.WithMany()
.HasForeignKey(x => x.UserId)
.OnDelete(DeleteBehavior.Cascade);
}
}