* Resolves the best available "change indicator" timestamp for a request. * * The JSM list endpoint does NOT return an updated/last-modified field — only * `createdDate` and `currentStatus.statusDate` are present. We use * `statusDate` (the time the request last changed status) when available, a
(request: JsmRequest)
| 170 | * not reflected here, so such changes may not trigger a re-sync. |
| 171 | */ |
| 172 | function getChangeIndicator(request: JsmRequest): string { |
| 173 | const statusDate = request.currentStatus?.statusDate |
| 174 | if (statusDate?.epochMillis != null) return String(statusDate.epochMillis) |
| 175 | if (statusDate?.iso8601) return statusDate.iso8601 |
| 176 | const created = request.createdDate |
| 177 | if (created?.epochMillis != null) return String(created.epochMillis) |
| 178 | if (created?.iso8601) return created.iso8601 |
| 179 | return '' |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * Builds a stub ExternalDocument from a request returned by the list endpoint. |