Hmz.Core.Notifications.Abstractions
0.1.1
dotnet add package Hmz.Core.Notifications.Abstractions --version 0.1.1
NuGet\Install-Package Hmz.Core.Notifications.Abstractions -Version 0.1.1
<PackageReference Include="Hmz.Core.Notifications.Abstractions" Version="0.1.1" />
<PackageVersion Include="Hmz.Core.Notifications.Abstractions" Version="0.1.1" />
<PackageReference Include="Hmz.Core.Notifications.Abstractions" />
paket add Hmz.Core.Notifications.Abstractions --version 0.1.1
#r "nuget: Hmz.Core.Notifications.Abstractions, 0.1.1"
#:package Hmz.Core.Notifications.Abstractions@0.1.1
#addin nuget:?package=Hmz.Core.Notifications.Abstractions&version=0.1.1
#tool nuget:?package=Hmz.Core.Notifications.Abstractions&version=0.1.1
Hmz.Core.Notifications.Abstractions
The contracts of the Hmz in-app notification engine (Hmz.Core.Notifications): what an
application declares (types, audiences, scopes) and what it calls (dispatch, resolve). The
package has no dependency at all, so a Contracts or Domain project can reference it without
pulling in EF Core or ASP.NET Core.
Namespace: Hmz.Core.Notifications.Abstractions.
Types
| Type | Purpose |
|---|---|
NotificationType(Code, Priority, DefaultAudience, Resolvable, RetentionDays, Channels) |
A registered type. Code is a stable kebab string (account.access-pending) and is never renamed. |
NotificationPriority, NotificationChannels |
P1..P3; InApp (the only channel today). |
NotificationRequest(TypeCode, DedupKey, OccurredAt) |
What a source produces, plus Audience?, ActorUserId? (always excluded), Scope?, Target?, Payload?. |
AudienceRule, UsersAudience, PermissionHoldersAudience, RoleHoldersAudience |
Who receives it. The engine resolves UsersAudience itself; the others need a resolver. |
IAudienceRuleResolver<TRule> |
Resolves one rule type to user ids. Add your own rule types freely. |
NotificationScope(Kind, Id), INotificationScopeAccess, NotificationScopeAccessSet |
The visibility scope (an organisation unit, a tenant, a brand) and its access check. |
NotificationTarget(Kind, Values) |
The deep link, stored and returned as one flat JSON object. |
INotificationDispatcher, INotificationResolver |
Store notifications; close the ones a later fact made obsolete. |
NotificationSignal, NotificationSignalTypes |
A live signal and its type names; NotificationSignalTypes.RealtimeEventType (notification) is the realtime event they are published as. |
The Payload holds data (ids, snapshots), never pre-rendered text, and is serialized with
JsonSerializerDefaults.Web.
Usage
public static readonly NotificationType AccessPending = new(
"account.access-pending",
NotificationPriority.P1,
DefaultAudience: [new PermissionHoldersAudience("users.approve", Scoped: true)],
Resolvable: true);
await dispatcher.DispatchAsync(
new NotificationRequest(AccessPending.Code, $"access:{userId}", occurredAt)
{
ActorUserId = actorId,
Scope = new NotificationScope("tenant", tenantId),
Target = new NotificationTarget("user", new Dictionary<string, object?> { ["userId"] = userId }),
Payload = new { UserId = userId },
},
ct);
Registration, hosting and the endpoints are in the Hmz.Core.Notifications package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Hmz.Core.Notifications.Abstractions:
| Package | Downloads |
|---|---|
|
Hmz.Core.Notifications
In-app notification engine for Hmz backends on EF Core and PostgreSQL: deduplicated per-recipient store, audience and scope rules, REST endpoints, live signals through Hmz.Core.Realtime after commit and retention. |
GitHub repositories
This package is not used by any popular GitHub repositories.