It isn't ready to merge as written. Two things need fixing first: a failed export currently looks like a success, and every customer's email address goes into the logs. Both are small fixes, so merging tomorrow is still realistic.

The structure is good. The functions are small and each has one job, the SQL uses parameters properly, the date range is half-open, and the upload checks for HTTP errors. The problems below are about how the job behaves in production, not how it's organised.

## Must fix before merge

**1. Failures are hidden, so cron and finance never find out (lines 56–57).**
The `except Exception` logs the error and then `run()` returns normally, so the process exits with code 0.
- **Example:** the finance endpoint returns a 500 at 02:00. `raise_for_status()` raises, one log line is written, and the job exits 0. Nobody gets alerted, and that day's invoices never reach finance.
- **Expected:** the job exits non-zero so cron or monitoring notices.
- **Fix:** use `log.exception("export failed for %s", day)` (which also keeps the traceback that `%s` drops), then `raise`, or let the exception propagate.

**2. Every customer email is logged (line 52).**
`[row[1] for row in rows]` writes all of yesterday's paying customers' email addresses into the info log. That is personal data ending up in log storage, which usually has wider access and longer retention than the database. Log only the count.

**3. There are no tests for the failure paths.**
The docstring says `test_export_job.py` covers the CSV header and one row, but that file isn't in this folder, so I couldn't check it. Either way, nothing tests the paths that matter most here. Before merging I'd add:
- An upload failure makes the job fail. This test would catch item 1.
- Zero invoices still produces a CSV with just the header, and still uploads it, if that's what finance expects.
- Amount formatting (see item 5).

Testing this will be awkward because of line 16. `os.environ["FINANCE_UPLOAD_URL"]` is read when the module is imported, so importing it in a test without that variable set fails with a `KeyError`. Reading it inside `upload()` or `run()` fixes that.

## Should fix soon (fine as a follow-up ticket)

4. **No timeout on the upload (line 42).** `requests.post` without `timeout=` can hang forever if the endpoint stalls, and the job never finishes. Adding `timeout=60` is a one-line fix.
5. **Amounts use float division (line 37).** `amount_cents / 100` assumes every currency has two decimal places.
   - **Example:** a ¥500 invoice stored as 500 is exported as `5.0`; it should be `500`.
   - Separately, `1050` becomes `10.5`, not `10.50`.
   - If everything is in one two-decimal currency, a `Decimal` with fixed formatting is enough. Otherwise, look up each currency's number of decimal places.
6. **Timezones may not line up (lines 28 and 47).** "Yesterday" comes from the server's local date, while `paid_at` is compared against midnight in the database session's timezone. If those differ, invoices paid near midnight end up in the wrong day's file, or in none. Pin both to UTC, or whatever timezone finance reports in.
7. **You can't re-run a past day.** The day is always "yesterday", so if Tuesday's run fails you can't re-send Tuesday's file on Thursday. Accepting an optional `--date` argument would fix this.
8. **Info logs are probably lost.** Nothing configures logging in `__main__`, so the "exporting…" and "finished" lines likely go nowhere; Python only shows warnings and errors by default. Add `logging.basicConfig(level=logging.INFO)`.
9. **Customer data is left on disk.** The CSVs, which include emails, stay in `/var/exports` indefinitely. Decide how long to keep them and what the file permissions should be.

Fixing items 1–3 (re-raise, drop the emails from the log, add the failure-path tests) is roughly an hour of work. Do that and add the timeout, and I'd be comfortable seeing this merged tomorrow.

VERDICT: NOT READY
