**Not ready to merge tomorrow.** Three problems block it: a failed export looks like a success, every customer's email address gets written to the logs each night, and the test file the docstring mentions doesn't exist. Each fix is small, so the work is about half a day plus tests.

## Blocking (fix before merge)

**1. Failures are hidden — High** (`export_job.py:56-57`)
`run()` catches every exception, logs one line and returns normally. Cron sees a clean exit and nobody gets alerted.
- Example: the finance endpoint returns a 503 at 02:00. `raise_for_status()` raises, the error is logged, and the process exits with code 0. Finance receives no file for that day and nothing tells anyone.
- Expected: the process exits non-zero so cron or monitoring raises an alert.
- Fix: log with `log.exception(...)`, then re-raise. Or catch nothing and let `finally` close the connection.

**2. Customer emails go into the logs — High** (`export_job.py:52`)
`[row[1] for row in rows]` puts every customer email from the export into an INFO log line every night. That is personal data spreading into log storage, which usually has wider access and longer retention than the database. Log the count only.

**3. There are no tests — High**
The docstring says the job is "Tested by test_export_job.py", but that file isn't in the directory. Even the coverage it describes ("CSV header and one row") would be thin. At minimum, before merge:
- `write_csv`: header, amount formatting (see #4), and an empty result set
- `fetch_invoices`: the date window, so only invoices from yesterday's day boundaries are included
- `run`: when the upload fails, the job fails (proves #1 is fixed)
- `upload`: a non-2xx response raises an error

Also remove the false sentence from the docstring.

## Should fix (merge only with a ticket and an owner)

**4. Money is converted to a float — Medium** (`export_job.py:37`)
`amount_cents / 100` creates a float, so the CSV format varies: 1000 cents becomes `10.0` and 1999 becomes `19.99`. Finance tooling often expects exactly two decimals. The code also assumes every currency has 100 minor units, which is wrong for some: a JPY invoice stored as 500 is exported as `5.0`. Fix: format with `Decimal` and a per-currency exponent, or export the integer `amount_cents` and let finance divide.

**5. "Yesterday" depends on two clocks — Medium** (`export_job.py:47`, `:28`)
- `date.today()` uses the cron host's local timezone.
- The `paid_at >= date` comparison uses the database session's timezone.
- If the two differ (say the host is UTC and the database session is US/Eastern), the window shifts by hours. Invoices near midnight then land in the wrong day or are dropped.

Pin both to one explicit timezone.

**6. A missed day can't be re-run — Medium**
The day is hard-coded to yesterday, so after a failed night there's no supported way to export that date again. Add an optional `--date` argument. This also makes `run` testable.

**7. Upload has no timeout and no retry — Medium** (`export_job.py:42`)
`requests.post` has no timeout, so a hanging endpoint stalls the job indefinitely. Add a timeout, plus a small bounded retry for connection errors and 5xx responses.

**8. CSV files with personal data pile up on disk — Medium** (`export_job.py:48`)
Each night a file of customer emails is left in `/var/exports` with default permissions and is never deleted. Set restrictive permissions and delete the file after a successful upload (or apply a retention policy). Write to a temp file and rename it, so a crash never leaves a half-written file.

## Minor

**9. Required config is read at import — Low** (`export_job.py:16`): `os.environ["FINANCE_UPLOAD_URL"]` runs when the module is imported, so tests crash without the variable. Read it inside `run()` or `upload()`.

**10. All rows loaded at once — Low** (`export_job.py:29`): `fetchall()` holds every row in memory. That's fine at nightly invoice volumes, but worth knowing if volume grows.

**11. Unknown re-upload behaviour — Low / open question:** I don't know whether the finance endpoint accepts a second upload of the same day or creates duplicates. This matters once #6 makes re-runs possible.

## If time is short
Fix #1 and #2 (a few lines each), add the tests in #3, and correct the docstring. Then #4–#8 can go in a follow-up ticket, but not silently: #4 and #5 can produce wrong finance data, so tell the finance team about them.

I only read the code; I didn't run anything. There's no test file to run, and I don't know the database column types or which timezone the cron host uses.

VERDICT: NOT READY
