feat(sms): NotificationType.Sms + recipient phone + SmsConfiguration + repo iface (S1)

This commit is contained in:
Joseph Doherty
2026-06-19 09:42:27 -04:00
parent 07dae35533
commit c5378f8723
5 changed files with 125 additions and 6 deletions
@@ -0,0 +1,38 @@
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications;
public class SmsConfiguration
{
/// <summary>Gets or sets the primary key.</summary>
public int Id { get; set; }
/// <summary>Gets or sets the Twilio Account SID.</summary>
public string AccountSid { get; set; }
/// <summary>Gets or sets the Twilio Auth Token (secret), or null when not applicable.</summary>
public string? AuthToken { get; set; }
/// <summary>Gets or sets the sender phone number (E.164) placed in the From field.</summary>
public string FromNumber { get; set; }
/// <summary>Gets or sets the Twilio Messaging Service SID used instead of a From number, or null.</summary>
public string? MessagingServiceSid { get; set; }
/// <summary>Gets or sets the Twilio REST API base URL, or null to use the provider default.</summary>
public string? ApiBaseUrl { get; set; }
/// <summary>Gets or sets the connection timeout in seconds.</summary>
public int ConnectionTimeoutSeconds { get; set; }
/// <summary>Gets or sets the maximum number of delivery retries before parking.</summary>
public int MaxRetries { get; set; }
/// <summary>Gets or sets the delay between retry attempts.</summary>
public TimeSpan RetryDelay { get; set; }
/// <summary>
/// Initializes a new <see cref="SmsConfiguration"/> with required fields and sensible defaults
/// for the numeric and timeout fields.
/// </summary>
/// <param name="accountSid">Twilio Account SID.</param>
/// <param name="fromNumber">Sender phone number (E.164) for the From field.</param>
public SmsConfiguration(string accountSid, string fromNumber)
{
AccountSid = accountSid ?? throw new ArgumentNullException(nameof(accountSid));
FromNumber = fromNumber ?? throw new ArgumentNullException(nameof(fromNumber));
ConnectionTimeoutSeconds = 30;
MaxRetries = 10;
RetryDelay = TimeSpan.FromMinutes(1);
}
}