Files
HealthLog/tests/integration/routes/parity/__snapshots__/workouts-batch.06-invalid.json.snap
T
Marc-André Bombeck dd52a8d92a test(workouts): pin the batch ingest before moving it into a service
A parity walk over POST /api/workouts/batch: a mixed first batch with every per-entry refusal and the cross-source twin, the same batch with an enrichment, a corrected hand entry, a kept track, both whole-batch refusals and a narrow bridge token. Responses, wide events, queue tails and stored workouts with their series and tracks are pinned.
2026-10-23 11:34:11 +02:00

226 lines
5.4 KiB
Plaintext

{
"status": 400,
"body": {
"data": null,
"error": "Invalid ISO datetime",
"meta": {
"errorCode": "workout.batch.invalid",
"requestId": "<requestId>"
}
},
"events": [
{
"status": 400,
"action": null,
"meta": {
"write_bucket": "own"
},
"warnings": null,
"error": null
}
],
"effects": [],
"stored": [
{
"id": "<id:1>",
"sportType": "running",
"startedAt": "2026-10-08T07:00:00.000Z",
"endedAt": "2026-10-08T07:50:00.000Z",
"durationSec": 3000,
"totalEnergyKcal": null,
"totalDistanceM": null,
"avgHeartRate": null,
"maxHeartRate": null,
"minHeartRate": null,
"stepCount": null,
"elevationM": null,
"pauseDurationSec": null,
"source": "APPLE_HEALTH",
"externalId": "hk-run-2",
"externalSourceVersion": null,
"metadata": null,
"samples": {
"samples": [
{
"t": "2026-10-14T06:30:00.000Z",
"hr": 121
},
{
"t": "2026-10-14T06:30:05.000Z",
"hr": 128,
"cadence": 168
},
{
"t": "2026-10-14T06:30:10.000Z",
"hr": 133
}
],
"sampleCount": 3
},
"route": null
},
{
"id": "<id:2>",
"sportType": "swimming",
"startedAt": "2026-10-11T07:00:00.000Z",
"endedAt": "2026-10-11T07:40:00.000Z",
"durationSec": 2400,
"totalEnergyKcal": null,
"totalDistanceM": 1500,
"avgHeartRate": null,
"maxHeartRate": null,
"minHeartRate": null,
"stepCount": null,
"elevationM": null,
"pauseDurationSec": null,
"source": "APPLE_HEALTH",
"externalId": "hk-swim-1",
"externalSourceVersion": null,
"metadata": null,
"samples": null,
"route": null
},
{
"id": "<id:3>",
"sportType": "walking",
"startedAt": "2026-10-12T18:00:00.000Z",
"endedAt": "2026-10-12T18:30:00.000Z",
"durationSec": 1800,
"totalEnergyKcal": null,
"totalDistanceM": null,
"avgHeartRate": null,
"maxHeartRate": null,
"minHeartRate": null,
"stepCount": null,
"elevationM": null,
"pauseDurationSec": null,
"source": "MANUAL",
"externalId": null,
"externalSourceVersion": null,
"metadata": null,
"samples": null,
"route": null
},
{
"id": "<id:4>",
"sportType": "walking",
"startedAt": "2026-10-12T18:00:00.000Z",
"endedAt": "2026-10-12T18:30:00.000Z",
"durationSec": 1800,
"totalEnergyKcal": null,
"totalDistanceM": null,
"avgHeartRate": null,
"maxHeartRate": null,
"minHeartRate": null,
"stepCount": null,
"elevationM": null,
"pauseDurationSec": null,
"source": "MANUAL",
"externalId": null,
"externalSourceVersion": null,
"metadata": null,
"samples": null,
"route": null
},
{
"id": "<id:5>",
"sportType": "cycling",
"startedAt": "2026-10-13T16:00:00.000Z",
"endedAt": "2026-10-13T17:05:00.000Z",
"durationSec": 3900,
"totalEnergyKcal": null,
"totalDistanceM": 2400,
"avgHeartRate": null,
"maxHeartRate": null,
"minHeartRate": null,
"stepCount": null,
"elevationM": null,
"pauseDurationSec": null,
"source": "MANUAL",
"externalId": "manual:ride-1",
"externalSourceVersion": null,
"metadata": null,
"samples": null,
"route": null
},
{
"id": "<id:6>",
"sportType": "running",
"startedAt": "2026-10-14T06:30:00.000Z",
"endedAt": "2026-10-14T07:15:00.000Z",
"durationSec": 2700,
"totalEnergyKcal": 610,
"totalDistanceM": 8200,
"avgHeartRate": 148,
"maxHeartRate": 171,
"minHeartRate": null,
"stepCount": null,
"elevationM": null,
"pauseDurationSec": null,
"source": "APPLE_HEALTH",
"externalId": "hk-run-1",
"externalSourceVersion": null,
"metadata": {
"HKIndoorWorkout": false
},
"samples": {
"samples": [
{
"t": "2026-10-14T06:30:00.000Z",
"hr": 121
},
{
"t": "2026-10-14T06:30:05.000Z",
"hr": 128,
"cadence": 168
},
{
"t": "2026-10-14T06:30:10.000Z",
"hr": 133
}
],
"sampleCount": 3
},
"route": null
},
{
"id": "<id:7>",
"sportType": "running",
"startedAt": "2026-10-15T06:30:00.000Z",
"endedAt": "2026-10-15T07:15:00.000Z",
"durationSec": 2700,
"totalEnergyKcal": null,
"totalDistanceM": null,
"avgHeartRate": null,
"maxHeartRate": null,
"minHeartRate": null,
"stepCount": null,
"elevationM": 6,
"pauseDurationSec": null,
"source": "APPLE_HEALTH",
"externalId": "hk-run-3",
"externalSourceVersion": null,
"metadata": null,
"samples": null,
"route": {
"geometry": null,
"sealed": true,
"sampleTimestamps": [
{
"t": "2026-10-14T06:30:00.000Z",
"hr": 120
},
{
"t": "2026-10-14T06:31:00.000Z",
"hr": 131
},
{
"t": "2026-10-14T06:32:00.000Z",
"hr": 137
}
]
}
}
]
}