support PWA notification.
ci-cd-vm / ci-cd (push) Failing after 1m34s

This commit is contained in:
Chris Chen
2026-06-29 22:20:15 -07:00
parent 45d910b554
commit b9210f2501
32 changed files with 1054 additions and 12 deletions
@@ -0,0 +1,19 @@
namespace ROLAC.API.Services.Notifications;
/// <summary>The three fields a browser hands over when it creates a push subscription.</summary>
public sealed record WebPushTarget(string Endpoint, string P256dh, string Auth);
/// <summary>
/// Outcome of pushing to one subscription. <see cref="IsExpired"/> is true when the push service
/// reported the subscription is gone (HTTP 404/410) so the caller can prune it.
/// </summary>
public sealed record WebPushSendResult(bool Success, bool IsExpired, string? Error);
/// <summary>
/// Thin wrapper over the WebPush library's encrypt-and-POST so that <see cref="WebPushService"/>'s
/// recipient resolution, pruning, and logging can be unit-tested without a real push service.
/// </summary>
public interface IWebPushSender
{
Task<WebPushSendResult> SendAsync(WebPushTarget target, string payloadJson, CancellationToken ct = default);
}