Context
The billing engine uses a large switch-case for pricing model selection, making it difficult to extend or test individual pricing strategies.
Current Limitation/Problem
Adding a new pricing model (tiered usage, hybrid, custom) requires modifying the core billing engine file, risking regressions across all pricing models.
Expected Outcome
Strategy pattern: each pricing model is a separate class implementing a common PricingStrategy interface, registered in a dynamic strategy registry.
Acceptance Criteria
Technical Scope
- backend/billing/domain/strategies/ - individual strategy class files
- backend/billing/domain/ - BillingEngine refactored to delegate to strategy
- backend/billing/domain/ - PricingStrategy interface and StrategyRegistry
- backend/billing/tests/ - strategy-specific test files with >90% coverage
Context
The billing engine uses a large switch-case for pricing model selection, making it difficult to extend or test individual pricing strategies.
Current Limitation/Problem
Adding a new pricing model (tiered usage, hybrid, custom) requires modifying the core billing engine file, risking regressions across all pricing models.
Expected Outcome
Strategy pattern: each pricing model is a separate class implementing a common PricingStrategy interface, registered in a dynamic strategy registry.
Acceptance Criteria
Technical Scope