feat: report the source export timestamp on every travel export page
This commit is contained in:
1 parent
c2c55bc8b2
commit
272c811f4f
6 files changed
+49
-5
No files matched your search
@@ -202,6 +202,7 @@ an error: it returns `200` with an empty `data` array and the usual `meta`.
|
||||
"totalPages": 1,
|
||||
"skipped": 0,
|
||||
"pickupsWithoutMasterData": 0,
|
||||
"sourceGeneratedAt": "2026-09-29T11:11:01+02:00",
|
||||
"generatedAt": "2026-09-29T12:10:06+02:00"
|
||||
}
|
||||
}
|
||||
@@ -211,8 +212,8 @@ an error: it returns `200` with an empty `data` array and the usual `meta`.
|
||||
is always an int and never null; `hotel` is always an object and never null; `pickups` is always an array, possibly
|
||||
empty, never null.
|
||||
|
||||
**`meta` describes the whole export, not the page.** `total`, `totalPages`, `skipped`, `pickupsWithoutMasterData`
|
||||
and `generatedAt` are identical on every page, so you can read them once on page 1 and decide whether to walk the
|
||||
**`meta` describes the whole export, not the page.** `total`, `totalPages`, `skipped`, `pickupsWithoutMasterData`,
|
||||
`sourceGeneratedAt` and `generatedAt` are identical on every page, so you can read them once on page 1 and decide whether to walk the
|
||||
rest. `total` is the row count **after** skips, and `totalPages` is `ceil(total / perPage)`.
|
||||
|
||||
- `skipped` — (travel, hotel) pairs dropped as unusable: a travel date that could not be parsed, or a hotel absent
|
||||
@@ -240,6 +241,11 @@ rest. `total` is the row count **after** skips, and `totalPages` is `ceil(total
|
||||
under one cache tag, so all three move together on an upstream sync rather than drifting between your calls.
|
||||
It is cached for 3 hours; `generatedAt` is when the cached copy was assembled, not when you requested it.
|
||||
|
||||
**Page consistency.** `sourceGeneratedAt` is the timestamp of the upstream export the rows were built from — the
|
||||
same value `GET /api/last-update` reports, as ISO-8601 — or `null` if it could not be read. An upstream sync can
|
||||
replace the cached copy while you are walking the pages; if `sourceGeneratedAt` differs from the value you saw on
|
||||
page 1, you have stitched two exports together. Discard what you have and restart from page 1.
|
||||
|
||||
---
|
||||
|
||||
### Travels
|
||||
|
||||
Reference in new issue
Block a user