domain capa

domain-notifications

Notification orchestration across multiple channels

Notification orchestration across multiple channels

Tierdomain
Roleunclassified (baselined)
Pathcrates/domain/notifications
Edition2021
Targetsdomain_notifications
Public items0 across 0 modules
Tests50

What it is for

domain-notifications: Notification orchestration across multiple channels

Overview

This crate provides a notification system that delivers messages about events through multiple channels. It handles notification creation, delivery tracking, user preferences, and templates.

Important: This is an orchestration crate, not an email crate. Actual delivery is handled by channel-specific adapters.

Layer

Domain - depends on: foundation-basemodels

Key Types

Channels

Example

use domain_notifications::{
NotificationService, CreateNotificationRequest, NotificationChannel, EntityRef
};

let service = NotificationService::new(pool);

// Create a notification
let (notification, event) = service.create_notification(CreateNotificationRequest {
tenant_id,
recipient_party_id: user_id,
event_type: "comment.mentioned".to_string(),
title: "You were mentioned".to_string(),
body: "Someone mentioned you in a comment".to_string(),
channel: NotificationChannel::InApp,
entity_type: Some("Comment".to_string()),
entity_id: Some(comment_id),
data: None,
idempotency_key: Some(format!("mention-{}-{}", comment_id, user_id)),
}).await?;

// Check user preferences before delivery
let can_deliver = service.can_deliver(
user_id, tenant_id, NotificationChannel::Email, "comment.mentioned"
).await?;

// Mark as read
service.mark_read(notification.id).await?;

// Get unread count
let unread = service.count_unread(tenant_id, user_id).await?;

Capabilities

No public items.

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

No public items.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
{DeliveryBackend,DeliveryResult,InAppBackend}delivery::{DeliveryBackend,DeliveryResult,InAppBackend}

Boundary

Reaches into foundation.

Shares tier domain with 41 other crates: domain-agreements, domain-ai-report, domain-billing, domain-catalog, domain-classify, domain-comments, domain-competitive-intel, domain-contact, … (41 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)domain
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/domain/notifications
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_domain["domain"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-basemodels`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2noalways
uuid^1v4, serdenoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1full, test-utilnoalways

Build. None.

Depended on by. 2 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_notifications["application-notifications"] -->|uses| SELF
  n_platform_privacy_scan_api["platform-privacy-scan-api"] -->|uses| SELF
  SELF["domain-notifications"]
  SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libdomain_notifications`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

2 workspace crates depend on this one: application-notifications, platform-privacy-scan-api.

Verification

KindCount
Unit tests50
Integration tests0
Examples0
Doctests0

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc00
Public modules with a //! block00

Metrics

MetricValue
Rust source files7
Source lines2856
Code lines2111
Public API items0
Public modules0
Tests50
Examples0
Cargo features0
Direct runtime dependencies8
Workspace reverse dependencies2
pie showData
    title Rust source composition
    "Code" : 2111
    "Blank or comment" : 745

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las domain · Manual