feat(notifications): SMTP delivery policy settable via management/CLI/UI (#149)

SmtpConfiguration.MaxRetries/RetryDelay (and ConnectionTimeoutSeconds/
MaxConcurrentConnections) drive the outbox Email policy but had no write
path, so every row sat at 0/0 and was clamped with a Warning; DEV vd03 had
to be fixed by direct SQL.

- Update/CreateSmtpConfigCommand: four trailing additive nullable fields
  (null = preserve on update / entity default on create; 0 = fallback).
- ManagementActor: preserve-if-null, negatives refused.
- CLI notification smtp create|update: --max-retries, --retry-delay-seconds,
  --connection-timeout-seconds, --max-concurrent-connections (>= 0).
- Central UI /notifications/smtp: fields on the form + read-only panel;
  new rows pre-fill 10 retries / 60 s.
- README + Component-NotificationService; tests for apply/preserve/reject.
This commit is contained in:
Joseph Doherty
2026-11-25 10:54:20 -05:00
parent a87c05754a
commit a4523e090e
9 changed files with 268 additions and 21 deletions
@@ -10,7 +10,9 @@ public record DeleteNotificationListCommand(int NotificationListId);
public record ListSmtpConfigsCommand;
// Transport is a trailing additive parameter (Smtp or Ews; null = preserve the
// stored value, which is itself null for every pre-EWS row and means Smtp).
public record UpdateSmtpConfigCommand(int SmtpConfigId, string Server, int Port, string AuthMode, string FromAddress, string? TlsMode = null, string? Credentials = null, string? OAuth2Authority = null, string? OAuth2Scope = null, string? Transport = null);
// The four delivery-policy fields (#149) are trailing additive too: null = preserve
// on update / entity default on create; 0 = use the outbox/options fallback.
public record UpdateSmtpConfigCommand(int SmtpConfigId, string Server, int Port, string AuthMode, string FromAddress, string? TlsMode = null, string? Credentials = null, string? OAuth2Authority = null, string? OAuth2Scope = null, string? Transport = null, int? ConnectionTimeoutSeconds = null, int? MaxConcurrentConnections = null, int? MaxRetries = null, TimeSpan? RetryDelay = null);
public record ListSmsConfigsCommand;
// FromNumber is optional: a Twilio Messaging-Service-only config supplies MessagingServiceSid
// instead. At-least-one-of (FromNumber, MessagingServiceSid) is validated at the CLI/UI boundary.
@@ -23,8 +25,8 @@ public record AddNotificationRecipientCommand(int NotificationListId, string Nam
/// <summary>Deletes one recipient without rewriting unrelated list membership.</summary>
public record DeleteNotificationRecipientCommand(int RecipientId);
/// <summary>Creates an email configuration using the update path's validation and secret projection.</summary>
public record CreateSmtpConfigCommand(string Server, int Port, string AuthMode, string FromAddress, string? TlsMode = null, string? Credentials = null, string? OAuth2Authority = null, string? OAuth2Scope = null, string? Transport = null)
: UpdateSmtpConfigCommand(0, Server, Port, AuthMode, FromAddress, TlsMode, Credentials, OAuth2Authority, OAuth2Scope, Transport);
public record CreateSmtpConfigCommand(string Server, int Port, string AuthMode, string FromAddress, string? TlsMode = null, string? Credentials = null, string? OAuth2Authority = null, string? OAuth2Scope = null, string? Transport = null, int? ConnectionTimeoutSeconds = null, int? MaxConcurrentConnections = null, int? MaxRetries = null, TimeSpan? RetryDelay = null)
: UpdateSmtpConfigCommand(0, Server, Port, AuthMode, FromAddress, TlsMode, Credentials, OAuth2Authority, OAuth2Scope, Transport, ConnectionTimeoutSeconds, MaxConcurrentConnections, MaxRetries, RetryDelay);
/// <summary>Creates an SMS configuration using the same validation as updates.</summary>
public record CreateSmsConfigCommand(string AccountSid, string? FromNumber, string? MessagingServiceSid = null, string? ApiBaseUrl = null, string? AuthToken = null, int? ConnectionTimeoutSeconds = null, int? MaxRetries = null, TimeSpan? RetryDelay = null)
: UpdateSmsConfigCommand(0, AccountSid, FromNumber, MessagingServiceSid, ApiBaseUrl, AuthToken, ConnectionTimeoutSeconds, MaxRetries, RetryDelay);