It's not ready to merge tomorrow. Two problems would cause real harm in production: when the export fails, nobody finds out, and every run writes customer email addresses into the logs. On top of that, the test file the docstring refers to isn't in this directory.

## Must fix before merge

**1. Failed exports look like successful ones (High).** `export_job.py:56-57` catches every exception, logs one line and returns normally. The process exits with code 0, so cron and any monitoring treat the run as a success.
- Example: the finance endpoint returns a 503 at 02:00. The log shows `export failed: 503 Server Error`, the exit code is 0, finance gets no file, and nobody is alerted.
- Fix: replace `log.error` with `log.exception` (which also records the stack trace, which is missing today) and re-raise, or call `sys.exit(1)`.

**2. Customer emails are written to the logs (High, privacy).** `export_job.py:52` logs `[row[1] for row in rows]`, which is the list of `customer_email` values, at INFO level on every run. Wherever these logs are shipped, that data goes too.
- Fix: log only the count and the date.

**3. The tests aren't here (High).** The docstring says the job is tested by `test_export_job.py`, but that file doesn't exist in this directory. Even if it exists somewhere else, a test covering "CSV header and one row" leaves out everything that can actually go wrong. These cases need tests:
- a day with no invoices
- the upload failing, which should give a non-zero exit
- the database failing
- formatting of amounts

## Should fix (Medium)

**4. Amounts are floats with no fixed format.** `export_job.py:37` writes `amount_cents / 100`.
- Example: 1000 cents is written as `10.0` instead of `10.00`, and 10 cents as `0.1` instead of `0.10`. A finance import that expects two decimal places may reject these or read them wrongly.
- Currencies without minor units are also wrong. If JPY is stored as 500, the file says 5.0.
- Fix: use `Decimal(amount_cents) / 100` formatted with two decimals, or the correct number of decimals for each currency.

**5. "Yesterday" depends on server timezones.** `datetime.date.today()` (line 47) uses the server's local timezone. The query then compares `paid_at` against a date with no timezone, and Postgres interprets that in the database session's timezone. If those two timezones differ from each other, or from the business day finance uses, invoices paid near midnight end up in the wrong file or in none. Pick UTC or the business timezone and use it explicitly in both places.

**6. The upload has no timeout.** `requests.post` on line 42 has no `timeout`, so if the endpoint stalls, the job hangs indefinitely and the next night's run can overlap with it. Add something like `timeout=60`.

**7. A missed day can't be re-run.** The date is hard-coded to yesterday. If a night fails, the only way to export that day is to edit the code. Accept an optional `--date` argument.

## Minor (Low)

**8. Importing the module crashes without the URL set.** `UPLOAD_URL = os.environ[...]` on line 16 runs at import time. Any test or tool that imports the module without `FINANCE_UPLOAD_URL` set fails with a `KeyError`. Read the variable inside `run()` or `upload()` instead.

**9. Failed runs leave a partial file.** If the job fails partway, a half-written CSV containing customer emails stays in `/var/exports`. Write to a temporary file and rename it once it's complete, and decide how long these files should be kept.

**10. Open question on empty days.** On a day with no paid invoices, the job uploads a file with only the header row. Confirm with finance whether they expect that file or would rather receive nothing.

## Minimum to merge
Fixes 1 to 3, plus the timeout (6), are small changes and could be done in a few hours. Fixes 4 and 5 change what finance receives, so they need a quick check with the finance team. If you have to merge without them, record them as known issues rather than leaving them unmentioned.

VERDICT: NOT READY
