I wouldn't merge this tomorrow as it stands. Two problems are blockers: a failed export looks like a success, and every customer's email address gets written to the logs. Each fix is small, so with the fixes and a few tests it could still go in tomorrow.

I read `export_job.py`. The docstring mentions `test_export_job.py`, but that file isn't in this folder, so I couldn't check the tests.

## Blockers

**1. A failed export reports success** (`export_job.py:56-57`)
`run()` catches every exception, logs it, and returns normally, so the process exits with status 0.
- Case: the finance endpoint returns HTTP 500. `raise_for_status()` raises, the error is logged, and the exit code is 0.
- What you get: cron and any monitoring see success, and finance never gets the file. Nobody hears about it until finance asks.
- What it should do: exit non-zero. Log with `log.exception(...)` and re-raise, or call `sys.exit(1)`.

**2. Customer emails end up in the logs** (`export_job.py:52`)
`[row[1] for row in rows]` logs every customer email at INFO level, every night. That's personal data going to wherever your logs are shipped and kept. Log only the count and the day.

## Should fix before merge

**3. No timeout on the upload** (`export_job.py:42`)
`requests.post` has no `timeout`. If the endpoint stops responding, the job hangs forever and the next night's run can overlap with it. Add something like `timeout=(10, 120)`.

**4. Amounts are written inconsistently** (`export_job.py:37`)
`amount_cents / 100` turns the amount into a float.
- Case: `amount_cents=1000` writes `10.0` and `amount_cents=5` writes `0.05`, when finance probably expects `10.00`.
- Fix: format with `Decimal(amount_cents) / 100` and `quantize(Decimal("0.01"))`, or with `f"{amount_cents // 100}.{amount_cents % 100:02d}"`. Either is exact for money and always gives two decimal places.

**5. Tests for the failure paths**
Even if the test file exists, the docstring says it only checks the CSV header and one row. Before merge I'd want tests that:
- the job exits non-zero when the upload fails;
- the query window runs from yesterday 00:00 up to (but not including) today 00:00;
- amounts come out with two decimal places (0, 5, 1000 and a large value);
- the log output contains no email addresses.

## Worth a decision (not blocking)

- **Which timezone defines "yesterday".** `date.today()` uses the server's local time, while the `paid_at >= %s` comparison uses the database session's timezone. If the two differ, or `paid_at` is a `timestamptz`, invoices near midnight can land in the wrong day's file or be left out. Pick UTC or the business timezone and set it explicitly.
- **No way to re-run a missed day.** The date is always "yesterday". A `--day YYYY-MM-DD` argument would let you backfill once failures actually surface after fix 1.
- **Config is read at import time.** `os.environ["FINANCE_UPLOAD_URL"]` runs at import (line 16), so importing the module in tests or tools fails with a `KeyError` unless that variable is set. Read it inside `run()` instead.

The small functions are a good split. Keeping the database query, CSV writing and upload separate is what makes the tests above easy to write.

VERDICT: NOT READY
