ci / build-test (push) Canceled after 0s
SaaS-мониторинг Telegram: ядро (модули Cards/Kanban/Pipeline/Tenants/Settings/ Discovery, Api, Infrastructure), сервисы telegram/ai/ml/storage, фронт Vue, контракты и grpc-hosting, деплой-конфиги (dev/prod/observability/CI-раннер), Gitea Actions CI, документация (ТЗ, техдок, api-map, код-стайл, планы, бэклог). Текущее состояние: все этапы роадмапа 0–12 закрыты, сборка 5 sln 0/0, тесты 1340/130/52/38/9 зелёные.
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Deal.Infrastructure.Persistence.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Deal.Infrastructure.Persistence.Configurations;
|
|
|
|
/// <summary>
|
|
/// EF-конфигурация пользователя
|
|
/// </summary>
|
|
public sealed class UserConfiguration : IEntityTypeConfiguration<UserEntity>
|
|
{
|
|
private const int LoginMaxLength = 200;
|
|
|
|
public void Configure(EntityTypeBuilder<UserEntity> builder)
|
|
{
|
|
builder.ToTable("users", "public");
|
|
|
|
builder.HasKey(x => x.Id);
|
|
|
|
builder.Property(x => x.Login).HasMaxLength(LoginMaxLength).IsRequired();
|
|
builder.Property(x => x.PasswordHash).IsRequired();
|
|
builder.Property(x => x.Status).IsRequired().HasDefaultValue("active");
|
|
builder.Property(x => x.CreatedAt).IsRequired().HasDefaultValueSql("now()");
|
|
|
|
builder.HasIndex(x => x.Login).IsUnique();
|
|
builder.HasIndex(x => x.TenantId);
|
|
|
|
builder.HasOne<TenantEntity>()
|
|
.WithMany()
|
|
.HasForeignKey(x => x.TenantId)
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
}
|
|
}
|