Not as it stands, but it is close: `export_job.py` needs four small fixes before merge, all doable today, and the overall structure is sound. This is from reading the file only; I did not run it, and `test_export_job.py`, which the docstring names, is not in the project folder.

## Must fix before merge

1. **A failed export looks like a success (high).** `run()` catches every exception at line 56, logs one line and returns, so the process exits with code 0.
   - Example: the finance endpoint returns 503 at 02:00. Cron records a successful run, and finance has no file for that day. The expected result is a non-zero exit so cron or monitoring alerts.
   - Fix: use `log.exception(...)` and re-raise, or `sys.exit(1)`.

2. **The upload can hang forever (high).** `requests.post` at line 42 has no `timeout`. If the finance endpoint accepts the connection and stalls, the job never ends and holds its database connection open.
   - Fix: add `timeout=(10, 120)` or similar.

3. **Customer emails are written to the log (high, privacy).** Line 52 logs every customer's email address for the day in one line.
   - Fix: log the count and the day only.

4. **Logging is never configured (medium).** There is no `logging.basicConfig` or handler, so under cron the two `log.info` lines are dropped. Only the bare error line reaches stderr, with no timestamp or traceback.
   - Fix: configure logging in the `__main__` block.

## Should fix, can follow shortly after

5. **A missed day cannot be re-run (medium).** The day is hard-coded to yesterday at line 47. After a failed night, the only way to backfill is to edit the code. A `--date` argument fixes it.
6. **Test coverage is thin (medium).** By the docstring, tests cover only the CSV header and one row. The date window in `fetch_invoices`, an upload failure and the failure path of `run()` are untested. A test for fix 1 should go in with it.
7. **Importing the module needs `FINANCE_UPLOAD_URL` (low).** Line 16 reads it at import time, so any test or tool that imports the file without it gets a `KeyError`. `DATABASE_URL` is read inside `run()`; do the same here.
8. **Amounts have inconsistent decimals (low).** `amount_cents / 100` at line 37 writes 1000 cents as `10.0` and 1050 as `10.5`, not `10.00` and `10.50`. Format with `Decimal` or `f"{amount_cents / 100:.2f}"`.
9. **A failed write leaves a partial file (low).** A crash mid-write leaves a truncated `invoices-<day>.csv` in `/var/exports`. Write to a temporary name and rename.

## Worth checking; I could not confirm from the file

- **Time zone of "yesterday".** `date.today()` uses the server's clock, and the query compares it to `paid_at` in the database session's time zone. If either differs from finance's business day, invoices paid near midnight land in the wrong day's file.
- **Currencies without two decimal places.** Dividing by 100 is wrong for JPY (no minor unit) or KWD (three decimals), if those occur.
- **Duplicate uploads.** A re-run posts the same file again; whether the finance endpoint de-duplicates is unknown.
- **Upload authentication.** The POST sends no credentials, so either the URL carries a token or the endpoint is open.
- **Spreadsheet formulas.** If finance opens the CSV in Excel, an email starting with `=` or `+` is treated as a formula.
- **Stored files.** The CSVs contain customer emails and are kept in `/var/exports` with default permissions and no clean-up.

VERDICT: READY WITH CHANGES
