**`export_job.py` isn't ready to merge tomorrow.** If the upload or the database query fails, the cron job still exits successfully, so finance would just not get a file and nobody would be told. I read the file only. I did not run it or its tests.

## Blockers (fix before merge)

1. **Failures are silent (high).** `run()` catches every exception (line 56), logs one line and returns normally, so cron sees exit code 0.
   - Example: the finance endpoint returns 503 at 02:00. `raise_for_status()` raises, the error is logged, and the job reports success.
   - Fix: log with `log.exception` (this keeps the traceback), then re-raise or `sys.exit(1)`.
2. **Customer emails are written to the logs (high, privacy).** Line 52 logs `[row[1] for row in rows]`, which is every customer email for the day, at INFO level. Log the count and the date only.
3. **Test coverage is too thin (high, given your standards).** The docstring says the only test covers a CSV header and one row.
   - Nothing covers `fetch_invoices`, `upload`, `run`, an empty day, a failed upload, or amount formatting.
   - Fix: add tests for the failure path (it would have caught blocker 1), the empty day, and the amount formatting.

## Should fix (medium)

4. **Amounts go through floating point (medium).** `amount_cents / 100` produces floats. Finance may see `1000.0` instead of `1000.00`. Currencies that don't use 2 decimals, such as JPY, would be exported wrong. Use `Decimal` and format by currency.
5. **`requests.post` has no timeout (medium).** A stalled endpoint hangs the job forever, and the next night's run piles up behind it. Add `timeout=`.
6. **"Yesterday" depends on timezones (medium).** `date.today()` uses the server's local time. Passing a plain date into a `paid_at` comparison uses the database session's timezone. Invoices near midnight could land on the wrong day. Pick one explicit timezone (probably UTC) and use it in both places.

## Minor (low)

7. **`UPLOAD_URL` is read at import time (line 16).** Importing the module without the env var raises `KeyError`, which makes tests awkward. Read it inside `run()`.
8. **A rerun overwrites the file and uploads again.** I can't tell whether the finance endpoint de-duplicates, so check that. There are also no retries on transient upload errors.
9. **The file is written in place (low).** A crash mid-write leaves a partial CSV in `/var/exports`. The file contains customer emails, so check its permissions.
10. **An empty day still uploads a header-only file.** This may be intended. Confirm with finance.
11. **Possible CSV formula injection (low).** An email beginning with `=` or `+` could be run as a formula if finance opens the file in Excel.

## Plan for tomorrow
Fixing blockers 1–3 plus the timeout (item 5) is small. I'd also pull the `UPLOAD_URL` read (item 7) into the same change, since it makes the tests easier. Items 4 and 6 are worth doing now if finance depends on exact amounts or day boundaries. The rest can go in a follow-up ticket.

VERDICT: NOT READY
