`export_job.py` is not ready to merge as written: four defects need fixing first, but they are about half a day's work including tests, so tomorrow is still realistic. I read the file only; I did not run it or open `test_export_job.py`, so the test coverage comments rely on the docstring ("CSV header and one row").

## Must fix before merge

1. **A failed export looks like a success** (`export_job.py:56-57`). `run()` catches every exception, logs one line and exits with code 0.
   - **Concrete case:** the finance endpoint returns 503 at 02:00. Expected: non-zero exit so cron or monitoring alerts. Actual: exit 0, one `export failed` line with no traceback, and finance has no file.
   - **Fix:** use `log.exception(...)` and re-raise, or `sys.exit(1)`.

2. **A missed day can never be re-run** (`export_job.py:47`). The day is hardcoded to "yesterday", so after the failure above, that day's invoices are never exported unless someone edits the code.
   - **Fix:** accept an optional date argument, e.g. `python export_job.py 2026-11-12`, defaulting to yesterday.

3. **Customer emails are written to the log** (`export_job.py:52`). The log line includes every customer's email address for the day, which is personal data in a log file.
   - **Fix:** log the count and the day only.

4. **The upload can hang forever** (`export_job.py:42`). `requests.post` has no timeout, so a stalled endpoint leaves the job running indefinitely and holding its database connection.
   - **Fix:** add `timeout=(10, 120)` or similar.

## Should fix, or confirm it is intended

- **Amounts are wrong for currencies without two decimals** (`export_job.py:37`). The code divides by 100 for every currency. A JPY invoice stored as 500 exports as `5.0`; expected `500`. Ignore this if you only bill in two-decimal currencies.
- **Amounts are inconsistently formatted.** 1000 cents exports as `10.0`; expected `10.00`. Use `Decimal` or `f"{cents // 100}.{cents % 100:02d}"` rather than float division.
- **The "yesterday" boundary depends on two time zones** (`export_job.py:28,47`). `date.today()` uses the host's time zone, and the date-to-`paid_at` comparison uses the database session's. If they differ, invoices near midnight land in the wrong day's file or are skipped. Pick one zone and build explicit timestamps.
- **Importing the module requires `FINANCE_UPLOAD_URL`** (`export_job.py:16`). It is read at import time, so any test that imports the module without it fails with `KeyError`. Read it inside `upload()` or pass it in, as `DATABASE_URL` already is.
- **Logging is never configured.** Run from cron, the `log.info` lines are dropped; only the error line reaches stderr. Add `logging.basicConfig(...)` under `__main__`.
- **Export files pile up** in `/var/exports` (`export_job.py:48`). They contain customer emails, are never cleaned up, and a failed run leaves a partial file. Write to a temp file and rename, and decide on retention.
- **Re-running a day may duplicate data at finance.** Nothing here tells the endpoint this is a replacement. Check how it treats a second upload of the same filename before adding the re-run option.

## Tests

By the docstring, only the CSV header and one row are tested. For a job that moves financial data, I'd want these before merge:

- `fetch_invoices` passes the right day window (start inclusive, end exclusive).
- `upload` raises on a non-2xx response and passes a timeout.
- `run` exits non-zero when the fetch, write or upload fails.
- `write_csv` with zero rows and with amounts like 1000 and 5 cents.

## Minor

- Open the CSV with `encoding="utf-8"` explicitly.
- A database connection failure (`export_job.py:49`) sits outside the `try`, so it crashes with a traceback while other failures are swallowed. Fixing item 1 makes this consistent.
- The SQL is parameterised correctly and the functions are small and well separated; no structural changes needed.

VERDICT: NOT READY
