feat: implement PriceCalculator rule for Epic 5.4#144
Conversation
Detailed TDD plan with 6 tasks: - Task 1: Quality multiplier tests (6 tiers) - Task 2: Supply/demand modifier tests - Task 3: Combined modifiers tests - Task 4: Edge case tests - Task 5: Rounding behavior tests - Task 6: Full verification Expected: 22 tests total Refs #43
Implements 6-tier quality multiplier system from GDD: - Crude (0-20): 0.5x - Common (21-40): 1.0x - Quality (41-60): 1.5x - Fine (61-80): 2.0x - Superior (81-99): 3.0x - Masterwork (100+): 5.0x Refs #43
Tests verify 4 market conditions: - Abundant (0.5x) - Normal (1.0x) - Scarce (1.5x) - Very Rare (2.0x) Refs #43
Tests verify realistic pricing with both quality and supply/demand: - Fine quality + scarce market - Crude quality + abundant market - Masterwork + abundant market Refs #43
Tests verify boundary conditions and error handling: - Quality at 0 and > 100 - Zero base price - Negative quality (throws exception) - Zero/negative supply/demand (throws exception) Refs #43
Tests verify: - Fractional copper amounts round correctly - Large values don't overflow - Standard Math.Round() behavior Refs #43
Recommended Persona Reviews💻 .NET Specialist - C# code changes detected See docs/roles/ for persona details. Danger analysis complete for feat: implement PriceCalculator rule for Epic 5.4. 5 files changed, 8 commits. |
Auto-Merge Status: BLOCKEDAuto-merge has been enabled for this PR, but it cannot merge automatically due to branch protection rules. Issue: PR created by mcj-coder (Maintainer account), which prevents self-approval. Merge State: BLOCKED - Likely requires approval from a different account (martincjarvis/Contributor) CI Status: All checks passing ✅
Code Review: Completed by code-reviewer subagent
Options to Unblock:
The PR is technically ready to merge - all quality gates passed. |
|
Closing PR created with Maintainer account. Will re-create with Contributor account per workflow rules (PROMPT.md line 17). |
Pull request was closed
Summary
Implements PriceCalculator rule that calculates item prices based on quality and basic supply/demand modifiers.
Issue
Closes #43
Changes
New Files:
src/FantasyRpgWorld.Core/Rules/PriceCalculator.cs- Static class with pure functions for price calculationtests/FantasyRpgWorld.Core.Tests/Rules/PriceCalculatorTests.cs- 22 tests covering all scenariosImplementation Details:
Testing
Test Coverage: 22 tests
Verification:
Pattern Verification:
Design Reference
See
docs/plans/2026-01-19-price-calculator-design.mdfor complete design rationale anddocs/plans/2026-01-19-price-calculator-implementation.mdfor TDD implementation plan.🤖 Generated via autonomous subagent-driven development