Normalise order ids in lookup_order ('#1042', 'order 1042')

main
No checks reported

Commit

Jaxson Sprinkles1mo ago

Customers write order numbers with a leading '#', an 'order' prefix, or stray whitespace. Strip a leading 'order' word (case-insensitive), any '#', and surrounding whitespace before looking up the id. Leading zeros are kept since ids like '0991' are significant. An id that is blank after normalising is treated as missing (falling back to email), and the not-found error echoes the normalised id.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Entire-Checkpoint: 01M4KHRRDTRNZ4YC3A9BSGGNTV