domain tier

domain-comments

Discussion threads and comments for any entity

Discussion threads and comments for any entity

Tierdomain
Roleunclassified (baselined)
Pathcrates/domain/comments
Edition2021
Targetsdomain_comments
Public items0 across 0 modules
Tests32

What it is for

domain-comments: Discussion threads and comments for any entity

Overview

This crate provides a universal comment system that can attach discussion relationships, allowing comments on Orders, Documents, CatalogItems, or any other entity type.

Layer

Domain - depends on: foundation-basemodels

Key Types

Example

use domain_comments::{CommentService, CreateThreadRequest, AddCommentRequest, EntityRef};

let service = CommentService::new(pool);

// Create a thread for an order
let (thread, event) = service.create_thread(CreateThreadRequest {
tenant_id,
entity_type: "Order".to_string(),
entity_id: order_id,
title: Some("Discussion".to_string()),
created_by: user_id,
}).await?;

// Add a comment with a mention
let user_to_mention = some_party_id;
let (comment, events) = service.add_comment(AddCommentRequest {
tenant_id,
thread_id: thread.id,
body: format!("Hey @{} please check this order", user_to_mention),
format: Default::default(),
parent_id: None,
created_by: user_id,
}).await?;

// The events include both comment.created and comment.mentioned

// Add a reaction
let (reaction, event) = service.add_reaction(comment.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.

No pub use re-exports: every item above is declared in this crate.

Boundary

Reaches into foundation.

Shares tier domain with 41 other crates: domain-agreements, domain-ai-report, domain-billing, domain-catalog, domain-classify, domain-competitive-intel, domain-contact, domain-conversation-engine, … (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/comments
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
lazy_static^1noalways
regex^1noalways
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. 1 workspace crate.

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

flowchart LR
  n_application_comments["application-comments"] -->|uses| SELF
  SELF["domain-comments"]
  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_comments`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.

1 workspace crate depends on this one: application-comments.

Verification

KindCount
Unit tests32
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 files6
Source lines1911
Code lines1388
Public API items0
Public modules0
Tests32
Examples0
Cargo features0
Direct runtime dependencies10
Workspace reverse dependencies1
pie showData
    title Rust source composition
    "Code" : 1388
    "Blank or comment" : 523

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.

All domain · Manual