Advantage Calculation Service
Component Detail
Description
Pure Dart service that executes the client-side impact calculation using a static, versioned impact model compiled into the app bundle. Accepts activity type, hours, and contact count as inputs and returns an estimated benefit figure with a per-category breakdown. No network call is made at runtime; the model version is exposed for display on the result screen.
advantage-calculation-service
Sources & reasoning
The calculation runs entirely client-side with a static versioned impact model per implementation notes. Isolating it as a pure Dart service enables full unit test coverage across all input combinations and keeps UI logic separate from business logic.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Execute impact calculation using static multipliers and lookup tables
- Return per-category benefit breakdown alongside total figure
- Expose current impact model version for UI display
- Provide unit-testable pure functions covering all input combinations
Interfaces
calculate(AdvantageInputParams) → AdvantageResult
getModelVersion() → String
getSupportedActivityTypes() → List<ActivityType>
Relationships
Related Data Entities (1)
Data entities managed by this component