It's close, and you can merge it tomorrow if you fix two things first. The structure is good: the query, the CSV writing and the upload are each a small function, the query is parameterized, the connection is always closed, and the date range is half-open (`>=` the start of the day, `<` the start of the next), so no invoice is counted on two days.

## Fix before merging

**1. The log line prints every customer's email address** (`export_job.py:52`).
`[row[1] for row in rows]` puts every email in the export into the log. With 3,000 paid invoices, that's 3,000 email addresses in your logs every night, kept as long as your logs are kept. That's personal data in a place it shouldn't be. Log only the count:
```python
log.info("exporting %d invoices for %s", len(rows), day)
```

**2. Failures are swallowed, so cron never finds out** (`export_job.py:56-57`).
If the upload returns a 500 or the database is down, `run()` logs one line and exits with code 0. Cron records a success, finance gets no file, and nobody is alerted. Also, `__main__` never sets up logging, so even that error line goes only to stderr with no traceback. Log the full error and re-raise it so the process exits non-zero:
```python
except Exception:
    log.exception("export failed for %s", day)
    raise
```
and add `logging.basicConfig(level=logging.INFO)` under `if __name__ == "__main__":`.

## Worth doing soon, not blocking

- **Add a timeout to the upload** (`:42`). `requests.post` with no timeout can hang forever if the finance endpoint stalls, and the next night's run would start alongside the stuck one. `timeout=30` fixes it.
- **Amounts assume every currency has 2 decimal places** (`:37`). This is fine if you only bill in USD/EUR/GBP. But a JPY invoice of ¥500 would export as `5.0`, and a currency with 3 decimal places (for example BHD) would be off by 10×. If you only use 2-decimal currencies, a one-line comment saying so is enough.
- **Timezone of "yesterday"** (`:47`). `date.today()` uses the server's local timezone. If `paid_at` is stored in UTC and the server isn't on UTC, invoices paid near midnight can land on the wrong day. Confirm which timezone finance expects.
- **Tests.** The docstring mentions `test_export_job.py`, but that file isn't in this folder, so I couldn't check it. Since change 2 alters how failures behave, add tests that a failed upload makes `run()` raise, and that the log contains no email addresses.

VERDICT: READY WITH CHANGES
