Service Layer low complexity mobile
0
Dependencies
1
Dependents
1
Entities
0
Integrations

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.

Feature: Advantage Calculator

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

Dependents (1)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component