Files
PnvPanel/backend/src/PnvPanel.Infrastructure/Persistence/Configurations/InboundConfiguration.cs
T
mrleo1nidandClaude Opus 5.5 bb5e59904f
CI / Backend (build + test) (push) Failing after 1m36s
CI / Frontend (lint + typecheck + build) (push) Successful in 41s
Add inbound country flags and node load in location picker
- Inbound.CountryCode (ISO alpha-2), set on publish; flag shown before
  the location name (SVG via country-flag-icons on the site, emoji in bot)
- Node.Capacity (optional, not a limit); available inbounds report load
  percent of capacity or active config count, sorted least loaded first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 19:45:17 +03:00

25 lines
925 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PnvPanel.Domain.Inbounds;
namespace PnvPanel.Infrastructure.Persistence.Configurations;
public class InboundConfiguration : IEntityTypeConfiguration<Inbound>
{
public void Configure(EntityTypeBuilder<Inbound> builder)
{
builder.ToTable("Inbounds");
builder.HasKey(x => x.Id);
builder.Property(x => x.RemoteInboundId).IsRequired().HasMaxLength(64);
builder.Property(x => x.Protocol).HasConversion<string>().HasMaxLength(32);
builder.Property(x => x.Remark).IsRequired().HasMaxLength(200);
builder.Property(x => x.DisplayName).HasMaxLength(100);
builder.Property(x => x.CountryCode).HasMaxLength(2);
builder.Property(x => x.AllowedRoleIds).HasColumnType("uuid[]");
builder.HasIndex(x => new { x.NodeId, x.RemoteInboundId }).IsUnique();
}
}