**Do not merge `export_job.py` as it stands: it has four defects that need fixing first, all small enough to still merge tomorrow.** I reviewed by reading only; I did not run anything or open `test_export_job.py`, so the test coverage comment relies on the file's own docstring.

## 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 exits with code 0.
   - Case: the finance endpoint returns 503 at 02:00. The job logs "export failed: 503 Server Error" and exits 0, so finance gets no file and nothing alerts.
   - Expected: non-zero exit and a traceback. Use `log.exception(...)` and re-raise, or drop the `except` entirely.

2. **Customer emails are written to the log** (`export_job.py:52`). The line logs `[row[1] for row in rows]`, which is every customer email in the export, every night. Log the count and the day only.

3. **The upload can hang forever** (`export_job.py:42`). `requests.post` has no `timeout`. If the endpoint accepts the connection and stalls, the job never ends and holds its database connection open. Add a timeout such as `timeout=(10, 120)`.

4. **Tests cover only the CSV header and one row.** Nothing tests the date window, the upload failure path or `run()`. At minimum add:
   - an invoice paid exactly at midnight lands in the right day;
   - an upload error makes `run()` fail;
   - an empty day.

## Confirm before merge

- **"Yesterday" may not match the database's idea of the day** (`export_job.py:47`, `:21`). `date.today()` uses the server's local timezone, while the `paid_at` comparison uses the database session's timezone if the column is `timestamptz`.
  - Case: the server is on UTC, the database session is on `America/New_York`, and an invoice is paid at 02:00 UTC on 14 Nov. That is 13 Nov in New York, so it is exported under the wrong day relative to finance's calendar.
  - Decide which timezone finance means by "yesterday" and make both sides explicit.

- **The success log lines probably never appear.** Nothing configures logging, so `log.info` is dropped by default and only the error line reaches stderr. Add `logging.basicConfig(level=logging.INFO)` under `__main__`, unless the cron wrapper configures it.

## Should fix, can follow shortly after

- **Amounts are formatted inconsistently** (`export_job.py:37`). `amount_cents / 100` writes 1010 as `10.1` and 2000 as `20.0`. Use `Decimal(amount_cents) / 100` formatted to two places. This also assumes every currency has two decimal places, which is wrong for JPY if it is stored in whole yen.
- **A missed day cannot be re-run.** `run()` takes no date, so recovering from the 503 case above means editing code. Accept an optional date argument.
- **Importing the module requires `FINANCE_UPLOAD_URL`** (`export_job.py:16`). It is read at import time, so any test importing the module crashes with `KeyError` unless the variable is set. Read it inside `upload()`, as `DATABASE_URL` is read inside `run()`.
- **CSV files with customer emails pile up in `/var/exports`.** They are created with default permissions, never deleted, and a partial file is left behind on failure.
- **No authentication is visible on the upload.** This is fine if the URL carries a token or the network is private; worth confirming.

The SQL itself is sound: it is parameterised, uses a half-open date range and has a stable order.

VERDICT: READY WITH CHANGES
