**Bottom line:** the structure is good. `fetch_invoices`, `write_csv`, `upload` and `run` each do one job, the query is parameterised, and the connection is closed in `finally`. But two problems, a swallowed failure and customer emails in the logs, mean it shouldn't merge as it stands. Both are small fixes you can make before tomorrow.

## Blockers

1. **Failures are silent (`export_job.py:56-57`).** `run()` catches every exception, logs one line and exits 0.
   - Case: the finance endpoint returns a 500 at 02:00. The log says "export failed", cron sees success, and finance never gets the file. Nobody is alerted.
   - Fix: re-raise, or log with `log.exception` and call `sys.exit(1)`. Add a test that an upload failure ends in a non-zero exit.

2. **Customer emails are written to the logs (`export_job.py:52`).** Every night the info log gets `[row[1] for row in rows]`, the full list of customer emails. That is personal data in a log file, with weaker access controls and retention than the database. It's also noisy for large days.
   - Fix: log the count and the day only.

## Should fix

3. **Weak test coverage.** The tests cover the CSV header and one row. Nothing covers an empty day, an upload failure, a DB failure, date boundaries or currency handling. Most of the issues below would have been caught by tests, so I'd add them as you fix each one.

4. **Day boundary and timezone (`export_job.py:28,47`).** `date.today()` uses the cron host's timezone. Passing a plain `date` to compare against `paid_at` uses the database session's timezone.
   - Case: the host is UTC and the DB is `America/New_York`. An invoice paid at 23:30 local time on the 13th can land in the wrong day's file, or in both or neither.
   - Fix: pick one timezone explicitly, convert `day` to explicit start and end timestamps, and test around midnight.

5. **Money is converted with float division (`export_job.py:37`).** `amount_cents / 100` is a float.
   - Zero-decimal currencies come out wrong: 500 JPY exports as `5.0`, which is 100 times too small.
   - Floats can also print unexpected digits in the CSV.
   - Fix: use `Decimal` with a per-currency exponent, or export the integer cents and name the column `amount_cents`.

6. **No timeout on the upload (`export_job.py:42`).** `requests.post` has no timeout, so a hung endpoint blocks the job forever. Cron could then stack up overlapping runs.
   - Fix: add `timeout=(5, 60)` or similar.
   - Related: there are no retries for transient errors. One 503 means a missed day.

7. **A missed day can't be recovered (`export_job.py:47`).** The day is hardcoded to yesterday. If cron or the host is down, there is no way to re-run for a specific date.
   - Fix: add an optional `--date` argument. It's a small change.

## Minor

8. **`UPLOAD_URL` is read at import time (`export_job.py:16`).** Importing the module without `FINANCE_UPLOAD_URL` set raises `KeyError`, which makes tests awkward. Read it inside `run()` or `upload()`.

9. **CSV formula injection (`export_job.py:37`).** If finance opens the file in Excel, an email field starting with `=`, `+`, `-` or `@` can be interpreted as a formula. Emails rarely start that way, but it's cheap to guard against.

10. **The CSV is written straight to its final path (`export_job.py:33`).** A crash mid-write leaves a partial `invoices-<day>.csv` in place. Write to a temp file and `os.replace` it.

11. **Files are never cleaned up, and `EXPORT_DIR` is hardcoded (`export_job.py:15`).** Each night leaves a file containing customer emails in `/var/exports`, and nothing deletes them. The directory is also assumed to exist. Consider a retention policy, restrictive file permissions, and making the directory configurable.

12. **Logging isn't configured.** There is no `logging.basicConfig`, so under cron the info lines are dropped (only warnings and above reach stderr). Even "export finished" never appears anywhere.

13. **An empty day uploads a header-only file.** This may be intended, so confirm with finance. If it is, a log line saying so would help.

14. **`fetchall()` loads everything into memory (`export_job.py:29`).** This is fine at the current volume. Streaming with a server-side cursor would only matter if volume grows.

15. **The error log has no traceback (`export_job.py:57`).** `log.error("...%s", error)` loses the stack trace. `log.exception` fixes this, and I'd fold it into item 1.

VERDICT: NOT READY
