feat(notifications): additive Transport column on SmtpConfigurations

This commit is contained in:
Joseph Doherty
2026-08-10 06:09:12 -04:00
parent d21b7a5a48
commit 3da84825fc
5 changed files with 2139 additions and 0 deletions
@@ -14,6 +14,14 @@ public class SmtpConfiguration
public string? Credentials { get; set; } public string? Credentials { get; set; }
/// <summary>Gets or sets the TLS mode (None, StartTLS, or SSL), or null to use the provider default.</summary> /// <summary>Gets or sets the TLS mode (None, StartTLS, or SSL), or null to use the provider default.</summary>
public string? TlsMode { get; set; } public string? TlsMode { get; set; }
/// <summary>
/// Gets or sets the email delivery transport ("Smtp" or "Ews"). Null/empty means Smtp
/// (legacy rows). Under Ews, <see cref="Host"/> holds the full EWS endpoint URL,
/// <see cref="AuthType"/> must be Basic, and Port/TlsMode/OAuth2* are unused.
/// </summary>
public string? Transport { get; set; }
/// <summary>Gets or sets the sender address placed in the From header.</summary> /// <summary>Gets or sets the sender address placed in the From header.</summary>
public string FromAddress { get; set; } public string FromAddress { get; set; }
/// <summary>Gets or sets the connection timeout in seconds.</summary> /// <summary>Gets or sets the connection timeout in seconds.</summary>
@@ -124,6 +124,10 @@ public class SmtpConfigurationConfiguration : IEntityTypeConfiguration<SmtpConfi
builder.Property(s => s.TlsMode) builder.Property(s => s.TlsMode)
.HasMaxLength(50); .HasMaxLength(50);
// Email transport discriminator ("Smtp"/"Ews"); null = Smtp for pre-EWS rows.
builder.Property(s => s.Transport)
.HasMaxLength(50);
builder.Property(s => s.FromAddress) builder.Property(s => s.FromAddress)
.IsRequired() .IsRequired()
.HasMaxLength(500); .HasMaxLength(500);
@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
{
/// <inheritdoc />
public partial class AddSmtpConfigurationTransport : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Transport",
table: "SmtpConfigurations",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Transport",
table: "SmtpConfigurations");
}
}
}
@@ -1064,6 +1064,10 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
b.Property<string>("Transport")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id"); b.HasKey("Id");
b.ToTable("SmtpConfigurations"); b.ToTable("SmtpConfigurations");