**Not ready to merge tomorrow as it stands.** The biggest problem is that the job can fail every night and cron will never know. I read only `export_job.py`. I did not open `test_export_job.py`, so what I say about tests comes from the docstring on line 3.

## Blocking

1. **Failures are swallowed (high), lines 56-57.**
   - `run()` catches every exception, logs one line, and exits with status 0.
   - Example: the finance endpoint returns a 500. `raise_for_status()` raises, the job logs "export failed", and cron records a success. Finance gets no file and nobody is alerted.
   - `logging` is also never configured, so under cron that error line may not be written anywhere. It also has no traceback.
   - Fix: log with `log.exception(...)` and re-raise, or call `sys.exit(1)`. Configure logging in `__main__`.

2. **Customer emails are written to the logs (high), line 52.**
   - `[row[1] for row in rows]` logs every paid customer's email address each night.
   - Fix: log only the count and the date.

3. **Tests don't cover the risky behaviour (high).**
   - The docstring says only a CSV header and one row are tested.
   - Nothing covers an empty day, the day-boundary query, a failed upload, a database error, or the exit status. The two blockers above would have been caught by a failure-path test.
   - This falls short of your tests-first standard. Suggested minimum:
     - an empty day;
     - a row at 23:59:59 and one at 00:00:00;
     - a mocked upload that returns a 500, asserting a non-zero exit;
     - an amount like 1000 cents.

## Should fix before merge

4. **Money is formatted as a float (medium), line 37.**
   - `amount_cents / 100` turns 1000 into `10.0` and 10 into `0.1`. Finance will probably expect `10.00` and `0.10`.
   - Use `Decimal(amount_cents) / 100` and format to two places.
   - This also assumes every currency has two decimal places. JPY has none and KWD has three, so check `currency` if you invoice in those.

5. **The upload has no timeout (medium), line 42.**
   - `requests.post` waits forever by default. A hung endpoint leaves the 02:00 job stuck, and the next night's run may overlap it.
   - Add `timeout=30` or similar.

## Minor

6. **`UPLOAD_URL` is read at import time (low), line 16.** Importing the module in a test without `FINANCE_UPLOAD_URL` set raises `KeyError`. `DATABASE_URL` is read inside `run()`, so the two are inconsistent. Read both in `run()`.
7. **`EXPORT_DIR` is hardcoded to `/var/exports` (low).** It makes local runs and tests awkward. Take it from an environment variable with that default.
8. **The CSV file is written directly to its final path (low).** A crash mid-write leaves a partial file. A later rerun overwrites it, so the risk is small.

## Speculative (not confirmed from the code)

- **Timezone:** `date.today()` uses the server's local time, while `paid_at` may be `timestamptz` compared in the database session's timezone. If those differ, invoices near midnight could land on the wrong day or be skipped. Check the column type and the server timezone.
- **Reruns:** rerunning after a partial failure uploads the same file again. I don't know whether the finance endpoint de-duplicates.
- **CSV injection:** an email beginning with `=` or `+` could be run as a formula if finance opens the file in Excel. This is only a concern if emails aren't validated on entry.

## Path to merge

Items 1, 2, 3, 4 and 5 are small. Items 1, 2 and 5 are about one line each. Items 3 and 4 are the real work, perhaps an hour including tests. Fixing them makes tomorrow realistic. Please confirm the timezone question before you rely on the date boundaries.

VERDICT: NOT READY
