pcm-engine
Product Catalog Engine (PCM) — the catalog heart of the BSS/OSS Rust ecosystem.
Status: implemented (v0.4.1) on crates.io. All four core feature areas below are available in the library API today.
Implemented features
| Area | What you get |
|---|---|
| Pricing rules & calculations | Base price, percentage / fixed discounts with conditions, valid_for windows, priority-based rule selection, complex models (tiered, volume, subscription, dynamic) |
| Product eligibility validation | All / Any rule sets, customer segment & attributes, has_product ownership checks, structured EligibilityOutcome with failure reasons |
| Bundling & product relationships | Mandatory / optional / exclusive bundles, runtime selection validation, relationships (DependsOn, Excludes, Requires, MigratesTo), bundle price calculation |
| Catalog versioning & lifecycle | Content snapshots of rules/bundles/relationships, create → publish → rollback, content-aware version diffs |
Entry point: CatalogEngine — register rules, call calculate_price, check_eligibility / explain_eligibility, qualify_and_price, bundle helpers, and create_version / publish_version / rollback_to_version.
Install
= "0.4.1"
Quick start
use ;
use Uuid;
let offering = new_v4;
let mut engine = new;
engine.add_pricing_rule;
let price = engine
.calculate_price
.expect;
assert!;
// Snapshot + publish catalog content
let catalog_id = new_v4;
let version = engine.create_version;
engine.publish_version.unwrap;
Qualify and price in one call
use ;
use Uuid;
let offering = new_v4;
let engine = new; // with rules already registered
let mut eligibility = new;
eligibility.customer_segment = Some;
let result = engine.qualify_and_price;
if result.eligible
Tests
Docs in this repo
- Root README — PCM section under Architecture / Core Engine Crates
- docs.rs/pcm-engine
License
MIT