**`export_job.py` is close, but not mergeable as it stands.** Three small fixes should go in before the merge; each is a line or two, so tomorrow is still realistic. I reviewed by reading the file only; I did not run it or open `test_export_job.py`.

The structure is sound: small single-purpose functions, a parameterised query, and a half-open date range (`>= day`, `< day + 1`) that avoids double-counting at midnight.

## Fix before merging

1. **A failed export looks like a successful one (lines 56-57).** The `except` logs the error and then swallows it, so the process exits with code 0.
   - **Failing case:** the finance endpoint returns a 500 at 02:00, and `raise_for_status()` raises. The job logs one line and exits 0, so cron and any monitoring see success and finance has no file for that day.
   - **Expected:** a non-zero exit.
   - **Fix:** use `log.exception(...)` to keep the traceback, then `raise`.

2. **Every customer email is written to the log (line 52).** `[row[1] for row in rows]` puts the full list of customer emails into the log line. On a day with 5,000 paid invoices, that is 5,000 email addresses in a log file, which usually has wider access and longer retention than the database. Log the count and the day only.

3. **The upload can hang forever (line 42).** `requests.post` has no timeout. If the finance endpoint accepts the connection and never responds, the job never finishes and the next night's run starts alongside it. Add `timeout=(10, 120)` or similar.

## Worth checking, not blocking

- **Amount conversion (line 37).** `amount_cents / 100` produces a float, so 1000 cents is written as `10.0`, not `10.00`. It is also wrong for currencies without two decimal places: 500 JPY would export as `5.0`. If finance needs two decimals or you bill in such currencies, format with `Decimal` and a per-currency exponent.
- **Which "yesterday" (line 47).** `date.today()` uses the server's local timezone, and the query compares against the database session's timezone. If those differ from finance's day boundary, invoices paid near midnight land in the wrong file. Confirm what `paid_at` stores.
- **Success logs are invisible.** Nothing configures logging, so when run as a script the `info` lines (including "export finished") are dropped. Add `logging.basicConfig(level=logging.INFO)` under `__main__`.
- **No way to re-run a missed day.** `run()` always exports yesterday. An optional date argument would make a backfill after a failure a one-line command.
- **Test coverage.** The docstring says the tests cover the CSV header and one row. Fix 1 deserves a test that a failed upload makes `run()` raise, and an empty day (zero invoices) is worth one too.
- **Import-time environment read (line 16).** `os.environ["FINANCE_UPLOAD_URL"]` at module level means importing the module in a test fails without that variable set. Reading it inside `upload()` avoids this.

VERDICT: READY WITH CHANGES
