**Not ready to merge tomorrow.** Two problems are real blockers: a failed export looks like a success, and customer emails are written to the logs. Both are small fixes, so tomorrow is still doable if you do those first.

I read `export_job.py` only. I did not run it, and I could not see `test_export_job.py`, so what I say about tests comes from the docstring.

## Blockers

**1. Failures are swallowed (high, `export_job.py:56-57`).**
- `run()` catches every exception, logs one line, and exits with code 0.
- Example: the upload endpoint returns a 500. `raise_for_status()` raises, the `except` logs "export failed", and cron sees a clean exit. Finance never gets the file, and nobody is alerted.
- Expected: the job exits non-zero, or re-raises after logging, so cron or monitoring can see it.
- `log.error` also drops the traceback. Use `log.exception`.

**2. Customer emails go to the logs (high, `export_job.py:52`).**
- The info line logs `[row[1] for row in rows]`, which is every customer email for the day, in plain text, every night.
- Expected: log only the count and the date.

## Should fix before merge

**3. Money is written as a float (medium, `export_job.py:37`).**
- `amount_cents / 100` gives a Python float. The output can be `19.9` instead of `19.90`, and very large values can print in scientific notation.
- Dividing by 100 is also wrong for currencies that don't have two decimal places. For example, JPY has none and KWD has three.
- Expected: use `Decimal`, format with the currency's exponent, and write a fixed number of decimals.

**4. The upload has no timeout (medium, `export_job.py:42`).**
- `requests.post` has no `timeout`. If the endpoint hangs, the 02:00 cron run hangs too, and the next night's run may start on top of it.

**5. Tests are thin (medium).**
- The docstring says the only coverage is the CSV header and one row.
- Missing cases:
  - no invoices for the day
  - an invoice just inside or just outside the day boundary
  - the upload failing
  - the database failing
  - the money formatting from item 3
- Items 1 and 3 are bugs that these tests would have caught. I'd add failing tests for them first, then fix them.

## Minor

- **Import-time crash (`export_job.py:16`).** `os.environ["FINANCE_UPLOAD_URL"]` runs at import, so tests and tooling fail with a `KeyError` unless the variable is set. Read it inside `run()` instead.
- **Hard-coded export directory (`export_job.py:15`).** `EXPORT_DIR` is fixed, and nothing checks that it exists. Make it configurable and create it if missing.
- **Whole result in memory (`export_job.py:29`).** `fetchall()` is fine at today's volume. A server-side cursor would be safer if volume grows.
- **Inconsistent failure handling.** If `psycopg2.connect` fails, the error crashes the job. Every other failure is swallowed. Once item 1 is fixed, this inconsistency goes away.

## Speculative (I couldn't confirm these from the file)

- **Time zones.** `date.today()` uses the server's local time, and `paid_at` is compared against bare dates using the database session's time zone. If the server is UTC and finance expects another zone, the day boundary shifts. Check which zone finance expects.
- **Re-runs.** The file name is fixed per day, so a re-run overwrites the file, but the upload would send a second copy. Check whether the endpoint de-duplicates.
- **Spreadsheet formulas.** An email that starts with `=` or `+` would be treated as a formula when the CSV is opened in Excel. This is low risk for email addresses.
- **File permissions.** The exported CSV contains customer emails and stays in `/var/exports`. Check its permissions and whether anything cleans it up.

## What's good

The SQL is parameterized and uses a half-open date range, so there's no injection risk or double-counting at midnight. The functions are small and separate fetching, writing and uploading. The connection is always closed.

## Minimum to merge tomorrow

Fix items 1 and 2, add a timeout (item 4), and add tests for the failure path and the empty day. Items 3 and 5 can follow right after if you name them as known debt in the PR.

VERDICT: NOT READY
