mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 14:15:44 +00:00
`findAll` selected `r.*` in raw SQL. `dataSource.query` bypasses the entity
mapping, so rows came back under their database names — `container_numbers`,
`submitted_at`, `quoted_total_amount` — while both clients read camelCase.
Every field on the row was undefined; the backoffice queue crashed on
`containerNumbers.join(", ")` and took the page down through the error
boundary.
Alias each column explicitly, the way `plannedReturns()` below it already
does, and cast the two numeric columns with `::float8` — raw SQL skips the
entity's numeric->Number transformer, which would otherwise hand the clients
strings. Type the result as `EmptyReturnRequestRow` so the signature matches
what the projection actually selects rather than claiming absent fields.
Guard the three `containerNumbers.join(...)` call sites too, so one odd row
cannot white-screen the queue again.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>