Define BenefitCalculationResult model
epic-benefit-calculator-foundation-task-001 — Create the immutable BenefitCalculationResult value object in Dart with typed fields for hourlyRateEquivalent, travelCostTotal, publicHealthSystemValue, totalSocietalValue, sessionCount, and averageDurationMinutes. Implement copyWith, equality (==, hashCode), toString, toJson, and fromJson. This model is the shared return type for the entire calculation pipeline.
Acceptance Criteria
Technical Requirements
Implementation Notes
Place the model in lib/features/benefit_calculator/models/benefit_calculation_result.dart. Use @immutable from package:meta. For equality and hashCode, prefer the equatable package (already common in BLoC projects) or manually implement using Object.hash(). Ensure fromJson uses safe casting: (json['sessionCount'] as num).toInt() rather than direct cast to avoid runtime type errors when Supabase or JSON returns numeric types inconsistently.
The totalSocietalValue field should be validated as the sum of other value components in tests to document the business invariant even if the model itself does not enforce it. Avoid depending on any other feature models to keep this class maximally reusable.
Testing Requirements
Unit tests using flutter_test. Test file: test/models/benefit_calculation_result_test.dart. Cover: default construction, copyWith (full and partial), equality reflexivity and symmetry, hashCode consistency, toJson produces correct keys and types, fromJson round-trip fidelity, fromJson with null value throws FormatException, BenefitCalculationResult.empty() returns all-zero/zero-int instance. No integration or widget tests needed.
Supabase organisation configuration table may not yet have the five multiplier columns, requiring a migration. If the migration is not coordinated with other teams touching the same table, schema conflicts could delay delivery.
Mitigation & Contingency
Mitigation: Add multiplier columns in a dedicated, non-destructive ALTER TABLE migration script. Review the organisation config table schema with the backend team before writing the migration. Use nullable columns with defaults so existing rows are unaffected.
Contingency: If the migration cannot be deployed in time, stub the repository to return hardcoded default multiplier values from a local config file, allowing parallel development. Swap in the real Supabase fetch once the migration is live.
The ActivitySummaryAggregator depends on activity records already persisted in the database. For newly onboarded peer mentors with no activity history, the aggregator will return zero counts, which could make the calculator appear broken on first use.
Mitigation & Contingency
Mitigation: Design the pre-fill value object to distinguish between 'no data yet' and 'zero activities'. The calculator input panel should display empty inputs (not zero) when no history exists, with placeholder text guiding the user to enter values manually.
Contingency: If the distinction cannot be surfaced cleanly in the UI timeline, fall back to always showing empty inputs and document the manual-entry path as the primary UX until activity data accumulates.