This isn't ready to merge tomorrow. Two things block it: when the export fails, it still reports success, and it writes every customer's email address into the logs. Also, the tests the docstring mentions don't exist. Both blocking fixes are small, so it can still make tomorrow if you get them in today.

I read `export_job.py` and looked for `test_export_job.py`. I didn't run anything, because there are no tests to run.

## Must fix before merge

**1. A failed export looks like a successful one (high)** – `export_job.py:56-57`
`run()` catches every exception, logs one line and returns normally, so the process exits with code 0. For example: the finance endpoint returns a 500, `raise_for_status()` raises, the job logs `export failed: 500 Server Error`, and cron records a successful run. Finance gets no file and nobody is alerted. The fix is to log with `log.exception(...)` and then re-raise (or `sys.exit(1)`), so cron and your monitoring see the failure.

**2. Customer emails are written to the logs (high)** – `export_job.py:52`
`[row[1] for row in rows]` puts every paying customer's email into an INFO log line every night. That's personal data going wherever your logs are shipped and kept. Log only the count, and the invoice IDs if you need them.

**3. The tests the docstring mentions don't exist (high)** – `export_job.py:3`
The docstring says the job is "Tested by test_export_job.py (CSV header and one row)", but that file isn't in the directory. Even as described, those tests would only cover `write_csv`. Before merging I'd want tests for:
- `write_csv`: the header, one row, and the amount formatting (see #4)
- `run()`: it exits non-zero when the upload fails, and the log line contains no email addresses
- `fetch_invoices`: it passes the correct date bounds (a fake cursor is enough)

There's one complication. `UPLOAD_URL = os.environ["FINANCE_UPLOAD_URL"]` (line 16) is read when the module is imported, so a test that just does `import export_job` crashes unless that variable is set. Read it inside `upload()` or `run()` instead.

## Should fix (medium)

**4. Amounts are calculated with floats** – line 37
`amount_cents / 100` turns 1050 into `10.5` and 100 into `1.0`, not `10.50` and `1.00`. Finance tools often expect exactly two decimal places, and floats are the wrong type for money anyway. Use `Decimal(amount_cents) / 100` and format the result with `:.2f`. Also check with finance whether any currency without cents, like JPY, can appear. Dividing those by 100 would be wrong.

**5. The upload has no timeout** – line 42
`requests.post` with no `timeout=` can hang forever if the endpoint stalls, and then the next night's run piles up behind it. Add something like `timeout=60`.

**6. "Yesterday" depends on the server's timezone** – lines 28 and 47
`date.today()` uses the server's local time, and the query compares `paid_at` against midnight in the database session's timezone. If those two differ from each other, or from the business day finance means, invoices paid near midnight end up on the wrong day or go missing. Please confirm which timezone finance expects and pin it explicitly. I can't check this from the code alone.

## Nice to have (low)

- **No way to re-run a missed day.** The date is always "yesterday", so if one night fails you can't backfill that date without editing code. A `--date` argument would solve it.
- **A partial file is left behind on failure.** If writing fails partway, a half-written CSV stays in `/var/exports`. Write to a temporary file and rename it when done.
- **The export folder is hard-coded.** `EXPORT_DIR` is fixed to `/var/exports`. Making it configurable would also make tests easier.

There's also one open question: the upload sends no credentials. Is the finance endpoint protected some other way, such as a token in the URL or network rules?

## Suggested order for today

1. Fix #1 and #2, which are a few lines each.
2. Add the tests in #3, including the change that lets the module import without the environment variable.
3. Fix #4 and #5, both one-liners.

#6 needs a quick answer from finance. If you can't get it today, write it down as known risk in the PR rather than leaving it unmentioned.

VERDICT: NOT READY
