- 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>
25 lines
925 B
C#
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();
|
|
}
|
|
}
|