I don't think it's ready to merge tomorrow. Two problems block it: if the export fails, nothing tells anyone, and every night's log lists every customer's email address. The test file the docstring names, `test_export_job.py`, isn't in the folder, so the job currently has no tests. Every problem below is a fix of a few lines, so getting it ready by tomorrow is realistic.

## Blockers

**1. Failures look like success** (`export_job.py:56-57`). The `except` writes the error to the log and then lets the script exit normally (exit code 0). Cron and any monitoring treat that as a successful run.
- *Case:* the upload endpoint returns a 500 error. The log gets one line, the process exits 0, and finance has no file for yesterday. Nobody finds out until finance asks.
- *Expected:* the process exits with an error code, so cron or alerting picks it up.
- *Fix:* log the error with `log.exception(...)`, then re-raise it (or `sys.exit(1)`).

**2. Customer emails written to the log** (`export_job.py:52`). `[row[1] for row in rows]` logs the email address of every paid customer, every night. That is personal data going into log storage, which usually has wider access and longer retention than the database.
- *Fix:* log only the count.

**3. No tests.** The docstring says the job is tested by `test_export_job.py`, but that file doesn't exist. Even if it did, a header-and-one-row test wouldn't cover the failure path above or the amount formatting below.
- *Minimum before merge:*
  - CSV content, including whole amounts like 1000 cents.
  - Upload failure makes `run()` raise or exit non-zero.
  - Customer emails don't appear in the log.
  - The date window for a given day.

## Should fix (medium)

**4. Amounts come out in inconsistent formats** (`:37`). Dividing cents by 100 gives a float.
- *Case:* 1000 cents is written as `10.0` and 1999 cents as `19.99`. Finance's importer may reject `10.0` or misread it.
- It's also wrong for currencies without 2 decimal places. JPY 500 would be written as `5.0`.
- *Fix:* use `Decimal(amount_cents) / 100` formatted to 2 places, or export the raw cents and let finance convert. Ask finance what their importer expects.

**5. "Yesterday" depends on the server's time zone** (`:47`, `:28`). `date.today()` uses the server's local time. The query compares `paid_at` against bare dates, which the database interprets in its own session time zone.
- *Case:* the server runs on UTC and finance works in US time. Invoices paid in the evening, US time, land in the next day's file.
- *Fix:* choose one time zone on purpose and pass timezone-aware start and end times.

**6. The upload can hang forever** (`:42`). `requests.post` has no `timeout`, so a stalled endpoint keeps the job running indefinitely and overlaps the next night's run.
- *Fix:* add `timeout=(10, 60)` or similar.

**7. The module fails if a setting is missing** (`:16`). `os.environ["FINANCE_UPLOAD_URL"]` is read when the file is imported, so importing it (from a test, for example) without that environment variable set raises `KeyError`.
- *Fix:* read the setting inside `run()` or `upload()`.

## Low

**8. A missed night can't be re-run.** The day is always computed as yesterday. Accept an optional date argument so someone can backfill a missed day.

**9. A failed write can leave half a file.** The CSV is written directly to its final path. Write to a temporary file and rename it into place.

**10. Info-level log lines never appear.** Nothing configures logging in `__main__`, so the logger stays at the default WARNING level and both `log.info` lines are dropped.

**11. `fetchall()` loads everything into memory.** That's fine at today's volumes. If invoice volume grows a lot, stream the rows instead.

**Open question:** the upload sends no authentication header. Confirm with finance that the endpoint really accepts unauthenticated uploads.

If you fix 1–3 tonight and add 6, since it's a one-line change, this could merge tomorrow. Items 4 and 5 need answers from finance before the change is correct, so if they slip, track them as a follow-up ticket.

VERDICT: NOT READY
