From c5d0cfbd258c11e93649dbe079fd77172212d809 Mon Sep 17 00:00:00 2001 From: "Kevin D. Wolf" Date: Wed, 28 Oct 2026 16:42:05 -0400 Subject: [PATCH 1/2] Add nonbreaking notification delivery flags and opt-in publisher contract --- .../Interfaces/INotificationPublisherV2.cs | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/LagoVista.Core/Interfaces/INotificationPublisherV2.cs diff --git a/src/LagoVista.Core/Interfaces/INotificationPublisherV2.cs b/src/LagoVista.Core/Interfaces/INotificationPublisherV2.cs new file mode 100644 index 00000000..ca736191 --- /dev/null +++ b/src/LagoVista.Core/Interfaces/INotificationPublisherV2.cs @@ -0,0 +1,47 @@ +using LagoVista.Core.Models; +using System; +using System.Threading.Tasks; + +namespace LagoVista.Core.Interfaces +{ + /// + /// Additive delivery-target flags. The legacy Targets enum and + /// INotificationPublisher signatures remain unchanged. + /// + [Flags] + public enum NotificationTargets + { + None = 0, + WebSocket = 1 << 0, + Push = 1 << 1, + Browser = 1 << 2, + Sms = 1 << 3 + } + + /// + /// Optional publisher capability for callers that explicitly select + /// multiple delivery transports. Existing publishers may continue to + /// implement INotificationPublisher only. + /// + public interface INotificationPublisherV2 : INotificationPublisher + { + Task PublishAsync(NotificationTargets targets, Notification notification, + NotificationVerbosity verbosity = NotificationVerbosity.Normal); + + Task PublishAsync(NotificationTargets targets, Channels channel, + string channelId, TPayload message, + NotificationVerbosity verbosity = NotificationVerbosity.Normal); + + Task PublishAsync(NotificationTargets targets, Channels channel, + string channelId, string text, TPayload message, + NotificationVerbosity verbosity = NotificationVerbosity.Normal); + + Task PublishAsync(NotificationTargets targets, TEntity entity, + NotificationVerbosity verbosity = NotificationVerbosity.Normal) + where TEntity : IIDEntity; + + Task PublishTextAsync(NotificationTargets targets, Channels channel, + string channelId, string text, + NotificationVerbosity verbosity = NotificationVerbosity.Normal); + } +} From 06ef508c8142817a3ab00d671ec2535bf0e31715 Mon Sep 17 00:00:00 2001 From: "Kevin D. Wolf" Date: Wed, 28 Oct 2026 16:42:40 -0400 Subject: [PATCH 2/2] Add optional delivery-target flags to notification queue envelope without changing legacy messages --- src/LagoVista.Core/Models/Notification.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/LagoVista.Core/Models/Notification.cs b/src/LagoVista.Core/Models/Notification.cs index f3225ad5..117f7075 100644 --- a/src/LagoVista.Core/Models/Notification.cs +++ b/src/LagoVista.Core/Models/Notification.cs @@ -23,6 +23,10 @@ public Notification() [JsonProperty("dateStamp")] public String DateStamp { get; set; } + // Absent in legacy queue messages: consumers retain existing WebSocket delivery. + [JsonProperty("deliveryTargets", NullValueHandling = NullValueHandling.Ignore)] + public NotificationTargets? DeliveryTargets { get; set; } + [JsonProperty("channel")] public EntityHeader Channel { get; set; }