I reviewed `export_job.py`. It is not ready to merge tomorrow. The main problem is that a failed export looks like a success, so finance could miss a day's invoices and nobody would be alerted. The module docstring also says it is "Tested by test_export_job.py", but that file isn't in this directory, so I couldn't find or run any tests.

## Must fix before merge

**1. Failures are hidden (`export_job.py:56-57`).** `except Exception` logs the error and carries on, so the process exits with code 0.
- Example: the finance endpoint returns a 500, `raise_for_status()` raises, the error is logged, and cron sees exit 0. Finance gets no file and no alert fires.
- Expected: a non-zero exit so cron or your monitoring flags it.
- Fix: log with `log.exception(...)` and then re-raise. Or remove the `except` and keep only the `finally`.

**2. Customer emails are written to the logs (`export_job.py:52`).** `[row[1] for row in rows]` puts every paying customer's email into the log every night. That's personal data leaking into a place with weaker access control and longer retention. Log only the count.

**3. Amounts are wrong for some currencies (`export_job.py:37`).** `amount_cents / 100` is float division and assumes every currency has 2 decimal places.
- JPY: 500 is stored as 500, but the export says `5.0`. It should say `500`.
- USD: 1000 is exported as `10.0`, not `10.00`.
- Fix: use `Decimal` and look up each currency's decimal places (JPY 0, KWD 3, most others 2).

**4. The tests are missing.** `test_export_job.py` doesn't exist here. Even as described, it only covers the CSV header and one row. Per your TDD standard, it needs at least these cases:
- an upload failure gives a non-zero exit
- a DB failure is handled
- an empty day still produces the header and an upload
- a currency with no decimals and a whole-number amount format correctly
- the date range is correct (start inclusive, end exclusive)

## Should fix

**5. The upload has no timeout (`export_job.py:42`).** If the endpoint stalls, `requests.post` can hang forever and the job never finishes. Add something like `timeout=(5, 60)`.

**6. Logging isn't set up when run from cron (`__main__`).** Nothing calls `logging.basicConfig`, so the `info` lines never appear. Errors only reach stderr through Python's fallback handler, so you'd have no record of successful runs.

**7. `FINANCE_UPLOAD_URL` is read at import time (`export_job.py:16`).** Importing the module without that variable set raises `KeyError`, which makes testing awkward. Read it inside `run()` or `upload()`, the same way `DATABASE_URL` already is.

**8. You can't rerun a missed day.** `run()` always exports yesterday. After an outage you can't backfill a given date. Let `run(day=None)` take an optional date, with a matching command-line argument.

**9. Timezone needs a decision.** `date.today()` uses the server's local time, and comparing `paid_at` against a plain date uses the database session's timezone. If they differ, or around daylight-saving changes, invoices near midnight can land in the wrong day's file or in none. Decide which timezone counts as "a day" for finance (probably UTC) and set it explicitly. I can't tell from the code whether `paid_at` stores a timezone, so check that.

## What's fine

The query is parameterised, so there's no SQL-injection risk, and the date window is half-open, so no invoice is counted twice. Each function has one job and the file is small. The connection is closed in `finally`.

Items 1–4 are each small, maybe an afternoon of work in total including the tests, so merging tomorrow is realistic if they're done today.

VERDICT: NOT READY
