feat(core): consolide le chainage type metier d'exercice -> strategie Health Services -> payload montre -> consommation Kotlin

Finalise #183 : modele/persistance des types metier d'exercice, mapping vers la strategie Health Services, propagation du payload dans le contrat watch bridge et consommation cote Kotlin montre. Perimetre complet QA vert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-30 16:17:31 +02:00
parent 30e657a67f
commit 2ae716206a
10 changed files with 444 additions and 22 deletions

View File

@ -54,6 +54,29 @@ void main() {
expect(projection.dominantTimer, isNull);
});
test(
'projects Health Services exercise type strategy from snapshot',
() async {
final repository = _FakeActiveSessionRepository()
..session = _session(
healthServicesExerciseTypeStrategy: const [
'RUNNING',
'HIGH_INTENSITY_INTERVAL_TRAINING',
'WORKOUT',
],
);
final projector = _projector(repository, _clock());
final projection = await projector.project(revision: 1);
expect(projection.healthServicesExerciseTypeStrategy, [
'RUNNING',
'HIGH_INTENSITY_INTERVAL_TRAINING',
'WORKOUT',
]);
},
);
test('projects running with step timer before stopwatch score', () async {
final now = DateTime.utc(2026, 7, 25, 12);
final session = _session(
@ -587,6 +610,7 @@ ActiveWorkoutSession _session({
bool? autoStartNextTimedStepSnapshot = true,
List<ExerciseStep> steps = const [],
String? secondExerciseName,
List<String> healthServicesExerciseTypeStrategy = const [],
}) {
final exerciseSnapshot = {
'id': 'exercise-snapshot-1',
@ -603,6 +627,7 @@ ActiveWorkoutSession _session({
.map((step) => step.toSnapshotJson())
.toList(),
'autoStartNextTimedStepSnapshot': ?autoStartNextTimedStepSnapshot,
'healthServicesExerciseTypeStrategy': healthServicesExerciseTypeStrategy,
};
final secondExerciseSnapshot = secondExerciseName == null
? null