Raw orders arrive as dicts with loosely typed values. Parse each one into the frozen dataclass Order from the starter code, or report everything wrong with it.
Write parse_order(raw) returning (Order, []) when the record is valid, and (None, errors) otherwise. Check the fields in this order — order_id, amount, order_date, status — and report every problem, one message per field, as "<field>: <reason>":
| field | accepted | coerced to | reasons |
|---|
order_id | an int, or a string of digits only ("42") | int | not an integer |
amount | an int or float, or a plain decimal string ("12.50", "-3"): optional minus, digits, optional . and digits | float | not a number; then negative if below 0 |
order_date | a date, or a string in exactly YYYY-MM-DD form that is a real date | date | not a date |
status | one of ALLOWED_STATUSES (exact match) | str | not an allowed status |
A field that is absent gets the reason missing. Booleans are never numbers, even though Python treats True as 1. Zero is a valid amount.
Python 3.13 in your browser — the standard library plus pandas and numpy; no pip installs.