I wouldn't merge this tomorrow as it stands. Two problems block it. If the export fails, the cron job still reports success, so nobody finds out. And every run writes all customer email addresses into the logs. The test file the docstring mentions (`test_export_job.py`) isn't in this folder, so I couldn't check any test coverage.

## Blocking

**1. Failures are silent (`export_job.py:56-57`)**
The `except Exception` logs one line and carries on, so the script exits with status 0.
- **Case:** the finance endpoint returns a 500 at 02:00. `raise_for_status()` raises, the error gets logged, and cron records a successful run. Finance receives no file and no alert fires. You'd expect a non-zero exit code so cron or your monitoring flags it.
- **Fix:** use `log.exception(...)` and then re-raise (or `sys.exit(1)`).

**2. Customer emails go into the logs (`export_job.py:52`)**
`[row[1] for row in rows]` logs every customer's email address each night. That copies personal data into your log store, which usually has wider access and longer retention than the database.
- **Fix:** log only the count and the date.

**3. No tests to check**
The docstring says `test_export_job.py` covers "CSV header and one row", but that file doesn't exist here. Even if it does exist elsewhere, nothing tests the paths that matter most:
- upload fails, so the job must exit non-zero
- no invoices for the day
- currencies that don't use cents (see item 5)
- invoices paid near midnight (see item 4)

## Should fix before or soon after merge

**4. Possible time-zone mismatch around midnight (`:28`, `:47`)**
`date.today()` uses the server's local time zone. The query compares the timestamp `paid_at` against a bare date, which Postgres reads as midnight in the database session's time zone.
- **Case:** the server runs on UTC, the database session uses US/Eastern, and an invoice is paid at 23:30 Eastern. That invoice can end up in the wrong day's file, or in no file at all.
- **Fix:** compute both bounds as explicit UTC timestamps.

**5. Amounts are converted as floats with a fixed 2 decimal places (`:37`)**
`amount_cents / 100` assumes every currency has 2 decimal places.
- **Case:** a JPY invoice of ¥500 stored as `500` comes out as `5.0`. KWD, which uses 3 decimal places, is also wrong.
- Float output can also show artefacts in some downstream tools.
- **Fix:** use `Decimal` with a per-currency exponent, or export the raw integer minor units and tell finance that's what the column contains.

**6. The upload can hang forever (`:42`)**
`requests.post` has no `timeout`, so a stalled endpoint can leave the cron job running indefinitely. Add something like `timeout=60`.

**7. A missed day can't be re-run (`:47`)**
`run()` always exports yesterday. If the 02:00 run fails, you can't export a specific date afterwards. Add `run(day=None)` and a CLI argument for the date.

## Minor

- **`:16`:** `os.environ["FINANCE_UPLOAD_URL"]` is read at import time. Importing the module without that variable set (in tests, for example) crashes with a `KeyError`. Read it inside `upload()` or `run()` instead.
- **`/var/exports`:** CSVs containing personal data pile up there and are never deleted. Decide on a retention period, or delete each file after a successful upload.

The structure itself is clean: small functions, a parameterised query, and the connection closed in `finally`. Fixing items 1–3 is a small diff. Item 4 needs a quick check of the server and database time-zone settings before you can tell whether it actually bites.

VERDICT: NOT READY
