stg_orders_raw holds orders exactly as a partner sent them — every field is text: raw_id, customer_id, order_date, amount, status. Before loading, check every row against the data contract. The rules, in this order:
1. missing_customer — customer_id is NULL, empty or only spaces. 2. bad_date — order_date is not a valid YYYY-MM-DD date (NULL included). 3. bad_amount — amount is not a plain number (digits with an optional minus sign and decimal point — no currency symbols or thousands separators), or it is negative. NULL is a bad amount; 0 is fine. 4. bad_status — status is not exactly one of 'placed', 'shipped', 'cancelled' (case matters). NULL is a bad status.
Return every row that breaks at least one rule, listing all the rules it breaks, in the order above, joined with , and no spaces (e.g. 'bad_date,bad_amount'). The check must not fail on bad data — it reports it.
Columns: raw_id, violations. Sort by raw_id.