Latest Records One Row Per Location
โถStep 5: One Row Per Location
GET /ingestions/assets/latest narrowed to the workflow's tag, with
?include=superseded. Captures latest_records_row_id and
latest_records_location_id.
โถWhat you should see
Two uploads of the same file, and one row per facility. The row is the step 3 record โ the one with the later window โ and it reports what it replaced:
"attributes": {
"superseded_count": 1,
"asset_task_ids": ["<step 3 task>", "<step 1 task>"],
"row_id": "<this record>"
},
"relationships": {
"superseded": {
"data": [{ "asset_task_id": "<step 1 task>", "monitoring_end": "2024-12-31โฆ",
"record_superseded_at": "โฆ" }],
"meta": { "total": 1, "truncated": false }
}
}
Compare it with GET /ingestions/assets using the same filter: that returns
both records. Neither count is wrong โ one counts locations, the other
counts records.
โถThe assertion worth borrowing
superseded_count and include=superseded are read by two different
statements, and this step asserts they agree. They are computed from the same
stored pointer precisely so that a caller comparing data.length against the
count never sees a row contradict itself.
โถNext Step
โ Step 6: The Whole Lineage โ the count says how many; /history says which,
in order, with the current one flagged.