domain tier

domain-crm

CRM pipeline: opportunities and configurable stages, attached to identity-parties (leads live on Person)

CRM pipeline: opportunities and configurable stages, attached to identity-parties (leads live on Person)

Tierdomain
Roleunclassified (baselined)
Pathcrates/domain/crm
Edition2021
Targetsdomain_crm
Public items0 across 0 modules
Tests29

What it is for

domain-crm: Opportunity + Stage pipeline library crates

Overview

Post-lead CRM pipeline: tenant-configurable Stages and Opportunity records attached to a identity_parties::Person or Organization. Leads are not modeled here -- identity_parties::Person already carries lead_status/lead_source/lead_owner_id; this crate starts after a lead has qualified into a pipeline opportunity (survey gap #3, docs/userstories/sprint-3.50-crm-pipeline.md, Gate 1.5 AC-scope).

Layer

Domain - depends on: foundation-basemodels, foundation-money

Key Types

a reuse of domain_contact::PartyType -- Gate 1.5 Round 2, OQ3)

Example

use domain_crm::{CrmService, CreateOpportunityRequest, OpportunityPartyKind};

let service = CrmService::new(pool);
service.ensure_default_pipeline(tenant_id).await?;

let (opp, event) = service.create_opportunity(CreateOpportunityRequest {
tenant_id,
party_id: person_id,
party_kind: OpportunityPartyKind::Person,
stage_id: new_stage_id,
name: "Managed services -- initial engagement".to_string(),
owner_id: staff_user_id,
value_amount: None,
value_currency: None,
source: Some("Referral".to_string()),
}).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-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/crm
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
`foundation-money`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
rust_decimal^1serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, json, rust_decimalnoalways
thiserror^2noalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
rust_decimal_macros^1noalways
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_crm["application-crm"] -->|uses| SELF
  SELF["domain-crm"]
  SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"]
  SELF -->|runtime| n_foundation_money["foundation-money"]
  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_crm`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-crm.

Verification

KindCount
Unit tests29
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 lines1469
Code lines1100
Public API items0
Public modules0
Tests29
Examples0
Cargo features0
Direct runtime dependencies9
Workspace reverse dependencies1
pie showData
    title Rust source composition
    "Code" : 1100
    "Blank or comment" : 369

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