**Not as it stands: `export_job.py` needs four fixes before merge, all small enough to land tomorrow.** The core logic (query, CSV writing, upload) is sound and readable. I reviewed only this file; I did not open `test_export_job.py` and am relying on the docstring's description of it.

## Must fix before merge

1. **A failed export looks like a success to cron** (`export_job.py:56-57`). `run()` catches every exception, logs one line and returns, so the process exits 0.
   - Example: the finance endpoint returns 503 at 02:00. Finance gets no file, cron reports success, and nothing alerts. The expected behaviour is a non-zero exit with a traceback.
   - Fix: use `log.exception(...)` and re-raise, or `sys.exit(1)`.
   - Related: the script never configures logging, so when run from cron the `log.info` lines are dropped and only the bare error message reaches stderr. Add `logging.basicConfig(level=logging.INFO)` under `__main__`.

2. **Customer emails are written to the logs** (`export_job.py:52`). The info line logs every customer's email address for the day. Log the count and the day only.

3. **The upload has no timeout** (`export_job.py:42`). `requests.post` waits forever by default, so a stalled endpoint hangs the job indefinitely and the next night's run starts alongside it. Add `timeout=(10, 120)` or similar.

4. **The failure paths and the date window are untested.** Per the docstring, tests cover only the CSV header and one row. There is nothing for the query's day boundaries, an upload failure, or `run()` failing.
   - `run()` is also hard to test because it hardcodes "yesterday". Making it `run(day=None)` fixes that.
   - The same change gives you a way to re-export a missed day, which today requires editing code.

## Should fix, can follow shortly after

- **Amount formatting is inconsistent** (`export_job.py:37`). `amount_cents / 100` writes 2000 as `20.0` and 1050 as `10.5`, where finance would expect `20.00` and `10.50`. Use `f"{amount_cents / 100:.2f}"` or `Decimal`. If you ever have JPY or other currencies without two decimal places, dividing by 100 is wrong for them.
- **"Yesterday" depends on two clocks** (`export_job.py:47`). The day comes from the server's local date, but the comparison against `paid_at` uses the database session's timezone if the column is `timestamptz`. If the two differ, invoices near midnight land in the neighbouring day's file. Pick the timezone explicitly.
- **`FINANCE_UPLOAD_URL` is read at import** (`export_job.py:16`). Importing the module without that variable raises `KeyError`, including in tests. Read it inside `upload()`, as `DATABASE_URL` already is.
- **Reruns upload a duplicate file.** Whether that matters depends on whether the finance endpoint de-duplicates by filename, which I can't tell from here.

## Questions for you

- The upload sends no credentials. Is authentication carried in the URL, or handled at the network level?
- CSVs containing customer emails accumulate in `/var/exports` with no cleanup. Is there a retention policy?

VERDICT: READY WITH CHANGES
