I read `export_job.py`; `test_export_job.py`, which the docstring names, isn't in this folder. **It's not ready for tomorrow, but it's close.** The structure is clean and every fix below is small. Two of them have to go in before merge: failures are currently hidden, and customer emails are written to the logs.

## Blockers

**1. Failures are hidden, so cron always thinks the job worked** (`export_job.py:56-57`)
`run()` catches every exception, logs it and returns normally. So the process exits with status 0 even when the upload fails.
- **Example:** the finance endpoint returns 500. `raise_for_status()` raises, the `except` logs one line, and the job exits 0.
- **Expected:** a non-zero exit, so cron mail or monitoring alerts someone.
- **Actual:** finance gets no file and nobody finds out until they ask.
- **Fix:** use `log.exception(...)` and then `raise`, or drop the `except` block and keep the `finally`.

**2. Every customer email is written to the logs every night** (`export_job.py:52`)
`[row[1] for row in rows]` puts each customer's email into an INFO log line. That's personal data in log storage, which usually has wider access and longer retention than the database. Log the count and the day only.

## Should fix before merge

**3. No tests in this folder.** The docstring says `test_export_job.py` covers the CSV header and one row. Even if that file exists somewhere else, that's only the happy path of `write_csv`. Missing:
- failure exit (#1)
- a day with no invoices
- an invoice paid at 23:59 vs 00:00 (#4)
- amount formatting (#5)
- upload error and timeout (#6)

**4. Which "yesterday" you get depends on the server's time zone** (`export_job.py:47`, `:28`)
`date.today()` uses the server's local date. Postgres then compares `paid_at` against midnight in the database session's time zone. If the server, the database session and finance's idea of "the day" differ, invoices near midnight go into the wrong file or no file.
- **Example:** server on UTC, finance working in US Eastern. An invoice paid at 21:00 Eastern on Nov 12 is 02:00 UTC on Nov 13, so it lands in the Nov 13 file instead of Nov 12.
- **Fix:** choose the time zone explicitly and pass timezone-aware datetimes as the query bounds.

**5. Amounts are floats and ignore each currency's decimal places** (`export_job.py:37`)
- **Example:** `100 / 100` writes `1.0`, but finance probably expects `1.00`.
- **Example:** JPY has no minor unit. If `amount_cents=500` means ¥500, the file says `5.0`.
- **Fix:** use `Decimal` formatted to the currency's number of decimal places. Or export `amount_cents` as-is and let finance convert.

**6. The upload has no timeout** (`export_job.py:42`)
`requests.post` with no timeout can hang forever if the endpoint stalls. The next night's run would then overlap with it. Add something like `timeout=(5, 60)`.

**7. Success messages never appear** (`export_job.py:13`, `:52`, `:55`)
Nothing configures logging, so Python's default only shows WARNING and above. Both `log.info` lines are silently dropped. Add `logging.basicConfig(level=logging.INFO)` under `__main__`.

## Minor

**8. The upload URL is read when the module is imported** (`export_job.py:16`). Importing the module, including from tests, crashes with `KeyError` unless `FINANCE_UPLOAD_URL` is set. `DATABASE_URL` is read inside `run()`, so the two are inconsistent. Read both inside `run()` or a small config function.

**9. A missed night can't be re-run.** The day is hard-coded to yesterday. Accepting an optional date argument makes recovering from a failed night (see #1) a single command.

**10. Re-running may upload the same day twice.** It's unclear whether the finance endpoint deduplicates by filename. Worth asking them, especially once #9 makes re-runs easy.

**11. CSV files with customer emails stay in `/var/exports` forever.** They're created with the default permissions, and nothing deletes them. Decide on retention, or delete each file after a successful upload.

**12. A partial file can be left behind.** If writing crashes halfway, a truncated CSV stays on disk. Writing to a temp file and renaming it fixes this. It's low risk today because upload only runs after the write succeeds.

**13. Empty days upload a header-only file.** That may be what you want. Just confirm finance expects a file on nights with zero invoices.

**14. `EXPORT_DIR` is hard-coded.** Taking it from an environment variable with `/var/exports` as the default would make local runs and tests easier.

What's already good: the query is parameterised (safe from SQL injection), the connection is always closed in `finally`, `newline=""` is set correctly for the CSV writer, and the functions are small and single-purpose. That's why every fix above is only a few lines. Fixing #1 and #2 plus tests for them is probably under an hour. With #3 to #7 as well, I'd be comfortable merging.

VERDICT: NOT READY
