The split follows what the field is for. Identity-bearing fields (id, symbol,
side, order type, quantity, prices) either read cleanly or the row is
quarantined: there is no substitute value that is safe to trade against, and
the old action === 'SELL' ? 'SELL' : 'BUY' turned a typo, a null and an
unrecognised broker enum alike into a BUY.
Status is descriptive, so an unmappable one degrades to unknown and the row
is KEPT. Hiding an order that exists is worse than showing one nobody can
classify, which is the opposite trade-off from the identity fields and is
deliberate.
Decode one order book row, failing closed.
The split follows what the field is for. Identity-bearing fields (id, symbol, side, order type, quantity, prices) either read cleanly or the row is quarantined: there is no substitute value that is safe to trade against, and the old
action === 'SELL' ? 'SELL' : 'BUY'turned a typo, a null and an unrecognised broker enum alike into a BUY.Status is descriptive, so an unmappable one degrades to
unknownand the row is KEPT. Hiding an order that exists is worse than showing one nobody can classify, which is the opposite trade-off from the identity fields and is deliberate.