Not yet. The core flow (query yesterday's paid invoices, write a CSV, upload it) is sound and short. But two problems mean it shouldn't run in production as written: a failed export looks like a success, and every customer email goes into the logs. Both are small fixes and could be done before tomorrow. I read `export_job.py` but couldn't read its tests: `test_export_job.py`, which the docstring mentions, isn't in this folder.

## Blockers (must fix before merge)

**1. A failed export looks like a success (high).** `export_job.py:56-57` catches every exception, logs one line and returns normally, so the process exits with code 0.
- **Example:** the finance endpoint returns 500, so `raise_for_status()` raises. The job logs `export failed: 500 Server Error` and exits 0. Cron and any monitoring see success, and finance never gets that night's file.
- **Expected:** the job exits non-zero so the failure is noticed.
- **Fix:** use `log.exception(...)` (it keeps the stack trace) and then re-raise, or `sys.exit(1)`.

**2. Customer emails are written to the logs (high).** `export_job.py:52` logs `[row[1] for row in rows]`, which is every customer's email, at INFO level, every night. That's personal data in logs, which usually have wider access and longer retention than the database. Log the count only.

**3. The tests aren't here, and the ones described are thin (high).** The docstring says the tests cover "CSV header and one row". Nothing covers the failure path (issue 1) or the money formatting (issue 4). Per our standards that isn't done. Minimum tests to add:
- the job exits non-zero when the upload fails
- the job exits non-zero when the database query fails
- an empty day still produces a CSV with just the header
- the amount formatting cases in issue 4

To make these easy to write, read `FINANCE_UPLOAD_URL` inside `run()` instead of at import time (see issue 6).

## Should fix (could follow soon after, but cheap to do now)

**4. Amounts go through floats and assume 2 decimals (medium).** `amount_cents / 100` at `export_job.py:37`:
- 10000 cents is written as `100.0`, not `100.00`.
- For currencies without cents, the value is wrong: a JPY invoice stored as 500 is exported as `5.0`.
- **Fix:** use `Decimal` and format by each currency's number of decimal places. At minimum, check with finance what format they expect.

**5. The upload has no timeout (medium).** `requests.post` at line 42 has no `timeout=`. If the endpoint stops responding, the 02:00 job hangs indefinitely and nothing alerts. Add something like `timeout=60`.

**6. Which "yesterday" is used depends on the server's timezone (medium).** `date.today()` uses the server's local timezone. If `paid_at` is stored as `timestamptz`, the database turns the date bounds into timestamps using its own session timezone. If those two timezones differ from finance's business day, invoices near midnight land in the wrong file or in none. Use an explicit timezone, e.g. UTC or finance's business timezone, for both.

## Minor

- **The upload URL is read at import time.** `UPLOAD_URL = os.environ[...]` at line 16 means just importing the module, e.g. in a test, fails with `KeyError` unless the variable is set.
- **You can't re-run a missed day.** The day is always "yesterday". Accepting an optional date argument makes recovery after an outage a one-line command.
- **The CSV stays on disk.** It's written to `/var/exports` with default permissions and never deleted, so customer emails pile up there. Restrict the permissions, or delete the file after a successful upload.

## Suggested path to merge tomorrow

Fix issues 1, 2, 3 and 5 today: the code changes are a few lines each, and the tests are the main work. Then confirm the amount format (4) and the timezone (6) with finance. If those take longer, file them as follow-up tickets rather than leaving them unrecorded.

VERDICT: NOT READY
