Overview
The Pricing module provides a sophisticated pricing engine that supports:- Multiple calculator types (fixed, step functions, time-based, etc.)
- Pricing components with versioning
- Composite pricing structures
- Applicability constraints and validity periods
- Price interpretations (total, unit, marginal)
Architecture
Calculator Types
Simple Fixed Calculator
Returns a constant price:Step Function Calculator
Price changes at quantity thresholds:Step Function
Step Boundaries:
LOWER: Price changes when quantity ≥ thresholdUPPER: Price changes when quantity > threshold
Discrete Points Calculator
Price from lookup table:Time-Based Calculators
Composite Calculator
Select calculator based on ranges:Composite
Percentage Calculator
Price Interpretations
The module supports three price interpretations:Interpretation Types
Automatic Conversion
The facade automatically converts between interpretations:Auto-conversion
Components
Components add versioning and business rules on top of calculators.Simple Component
Wraps a single calculator with applicability and validity:Simple Component
Composite Component
Combines multiple components:Composite Component
Component Dependencies
Pass calculated values between components:Dependencies
Component Versioning
Components support versioning for price changes over time:Versioning
Applicability Constraints
Control when pricing applies:Constraints
Validity Periods
Validity
Real-World Example: Bank Account Fees
From test scenarios:Bank Account Pricing
Best Practices
Use Components
Wrap calculators in components for versioning and business rules
Set Validity
Always define validity periods for price changes
Clear Interpretations
Specify interpretation (TOTAL/UNIT/MARGINAL) explicitly
Test Boundaries
Test step functions at boundary values
