Every analytics dashboard starts here: pull just the clean rows from a table that mixes statuses.
Return all PAID orders. Select order_id, customer_id, order_ts::DATE AS order_date, and amount_usd — sorted by order_id ascending. Skip anything refunded, cancelled, delivered, or with a NULL status.