`export_job.py` is not ready to merge as written: four problems can each cost finance a day of invoices or leak customer data. The fixes are small (roughly 30 lines plus tests), so tomorrow is still realistic if they go in today.

I reviewed by reading only; nothing was run. `test_export_job.py`, which the docstring cites, is not in this folder, so I could not check what the tests cover beyond the docstring's "CSV header and one row".

## Blockers (High)

| # | Problem | Concrete case | Fix |
|---|---|---|---|
| 1 | **Failures are swallowed.** `run()` catches every exception, logs one line and exits with code 0 (lines 56-57). | The finance endpoint returns 503 at 02:00. Cron records success, no alert fires, and finance has no file. | Re-raise after logging (or `sys.exit(1)`), and use `log.exception` so the traceback is kept. |
| 2 | **A failed day is never retried.** The date is hard-coded to "yesterday" (line 47). | The 14 Nov run fails. On 15 Nov the job exports only 14 Nov's invoices, so 13 Nov's are never sent. | Accept a `--date` argument so a day can be re-run. |
| 3 | **The upload has no timeout** (line 42). | The endpoint accepts the connection and never answers. The job hangs indefinitely and holds its database connection open. | `requests.post(..., timeout=(10, 120))`. |
| 4 | **Every customer email is written to the log** (line 52). | A night with 5,000 invoices puts 5,000 email addresses in one log line, in whatever log system collects it. | Log the count only. |

## Should fix (Medium)

- **Tests miss the risky parts.** Nothing covers the date window, a failed upload, `run()`'s error handling or amount formatting. Tests for blockers 1-3 should land with the fixes.
- **Amounts are converted with float division** (`amount_cents / 100`, line 37).
  - 1000 cents is written as `10.0` while 1999 is written as `19.99`, so the column format is inconsistent.
  - Dividing by 100 is wrong for currencies without two decimals: 500 JPY would be exported as `5.0`. This depends on how `amount_cents` is stored for those currencies.
  - Fix: format with `Decimal`, or send integer cents and let finance convert.
- **"Yesterday" depends on the server's time zone.** `date.today()` uses the server clock, and the database turns the date into midnight in its own session time zone. If the two differ, or finance works in a third zone, invoices near midnight land in the wrong day's file. Fix: pick one zone explicitly and build the boundaries from it.
- **Re-running sends the same file again.** Whether that creates duplicates on finance's side depends on their endpoint, so it needs confirming with them once `--date` exists.
- **CSV files with customer emails pile up in `/var/exports`.** They are never deleted and get default file permissions. Fix: delete after a successful upload, or set a retention period and `0600`.
- **The upload sends no credentials.** If the URL does not carry a token and the endpoint is not restricted to your network, this needs an auth header. I can't tell from the file.

## Minor (Low)

- **Import fails without the env var.** `UPLOAD_URL = os.environ[...]` runs at import (line 16), so importing the module in tests raises `KeyError` unless `FINANCE_UPLOAD_URL` is set. Read it inside `upload()` or pass it in.
- **Logging is never configured.** The `info` lines are dropped when the file runs as a script; only the error line reaches stderr. Add `logging.basicConfig` under `__main__`.
- **No file encoding is set** (line 33). Under cron's locale a non-ASCII email can fail on older Python versions. Use `encoding="utf-8"`.
- **Spreadsheet formulas are not escaped.** An email starting with `=` or `+` is treated as a formula if finance opens the CSV in Excel.
- **A partial CSV is left behind** if writing fails midway. Write to a temp file and rename.
- **An empty day uploads a header-only file.** Confirm finance expects that rather than no file.
- **All rows are loaded into memory** by `fetchall()`. Fine at current volumes, but worth knowing if they grow.
- **Nothing stops two runs overlapping**, for example a manual re-run during the cron run.

VERDICT: NOT READY
