It's close, but I wouldn't merge it as it stands. Two fixes need to go in first, and each is only a few lines. The structure is good: the query, the CSV writing and the upload are separate functions, the SQL uses parameters instead of string-building, and the connection always gets closed.

## Fix before merging

**1. A failed export looks like a successful one.** The `except Exception` in `run()` (`export_job.py:56-57`) logs the error and then returns normally. So the process exits with code 0 and cron sees success.
- **Example:** the finance endpoint returns a 500 at 02:00. You get one `export failed` log line, and nothing tells anyone that finance didn't get yesterday's invoices.
- **Fix:** keep the log line, add `raise` after it (or use `log.exception(...)` then `raise`). Then cron or your monitoring sees a non-zero exit.

**2. Customer email addresses go into the logs every night.** `export_job.py:52` logs `[row[1] for row in rows]`, which is the `customer_email` column for every invoice.
- **Example:** a day with 3,000 paid invoices puts 3,000 email addresses into the info-level logs, and they stay there as long as the logs are kept and reach whoever can read them.
- **Fix:** log only the count and the date. You already have both in that line.

## Worth doing now, or tracking as follow-ups

- **No timeout on the upload** (`export_job.py:42`). `requests.post` without `timeout=` can wait forever if the endpoint stops responding. Adding `timeout=60` (or whatever fits) is a one-line change.
- **Dividing every amount by 100** (`export_job.py:37`) assumes every currency has two decimal places. If any invoices are in JPY (no decimals) or KWD (three), finance gets wrong amounts: ¥1,500 is stored as 1500 and exported as 15.0. If you only bill in two-decimal currencies, this is fine, but it's worth a comment.
- **What "yesterday" means depends on time zones.** `date.today()` uses the server's local time zone, and the comparison with `paid_at` uses the database session's time zone. If those differ from what finance means by "yesterday", invoices paid near midnight can land in the wrong file. Check this once and write down the answer.
- **Tests.** The docstring says the tests cover the CSV header and one row, but `test_export_job.py` isn't in this folder, so I couldn't check it. Before merging, I'd add one test for fix 1: the upload raises, and `run()` should raise too. That's the case most likely to break again quietly.

**Optional:** `UPLOAD_URL` is read when the module is imported (`export_job.py:16`), so tests need that environment variable set even to import the file. And letting `run()` take an optional date would make it easy to re-run a missed day.

VERDICT: READY WITH CHANGES
