Files
edr-platform/apps
hager 808af074e2 fix(empty-return-requests): map queue columns to camelCase
`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>
2026-09-06 19:45:13 +00:00
..