Language: SQL. The pull request has one bug. You get three tries to find the line, then a short debrief.
Support's dashboard needs one line per order with its current status. Every change of status is a row in order_events (created, paid, shipped, delivered…), so we take one event per order with PostgreSQL's DISTINCT ON, which is shorter than a window function and faster here.
Codetrap needs JavaScript: the code review happens in your browser.