**Not ready to merge tomorrow.** Three things block it. If the export fails, nobody finds out. Every customer's email address gets written to the logs each night. And the test file the docstring points to isn't in the folder. Each fix is small, so a day's work should get it there.

## Blockers

**1. Failures are hidden (`export_job.py:56-57`).** The `except Exception` catches every error, logs one line and lets the script exit with code 0. Cron, and any monitoring that watches exit codes, will treat the run as a success.
- *Example:* the finance endpoint returns 503 at 02:00. `raise_for_status()` raises, the error is logged as `export failed: 503 Server Error`, and the process exits 0. Finance gets no file and no alert fires. *Expected:* the process exits non-zero (re-raise, or `sys.exit(1)`) so the failure shows up.
- There's also no way to re-run a missed day, because the day is always "yesterday" (`:47`). If the job is re-run the next morning, it exports the wrong day. Accept an optional date argument.
- Use `log.exception` instead of `log.error` so the traceback is kept.

**2. Customer emails go into the logs (`:52`).** `[row[1] for row in rows]` logs every customer's email address every night. That's personal data in log storage, which usually has wider access and longer retention than the database. *Fix:* log the count and the day only, or invoice IDs if you need traceability.

**3. The tests are missing.** The docstring says this is tested by `test_export_job.py`, but that file isn't in this directory. Even as described (CSV header plus one row), it wouldn't cover what matters here. Minimum before merge:
- a failed upload makes the job exit non-zero
- the database query uses the correct `[day, day+1)` bounds
- a day with no invoices behaves as you decide (right now it uploads a file with only the header row; confirm finance wants that)
- amount formatting (see below)

Testing will also need `UPLOAD_URL = os.environ["FINANCE_UPLOAD_URL"]` (`:16`) moved into `run()`. At the moment, importing the module without that variable set crashes with `KeyError`.

## Should fix (could be a fast follow if finance agrees)

**4. Amount formatting (`:37`).** `amount_cents / 100` produces a float:
- `100` → `1.0`, not `1.00`, so finance gets inconsistent decimal places.
- Not every currency has two decimal places. JPY has none, so 500 yen stored as `500` becomes `5.0`. KWD has three. If the table only ever holds two-decimal currencies, document that. Otherwise format by currency, using `Decimal` and not float.

**5. No timeout on the upload (`:42`).** If the endpoint hangs, `requests.post` waits forever, and the next night's cron run can overlap with it. Add `timeout=` (e.g. 30–60 s).

**6. Timezone of "yesterday" (`:47`, `:21`).** `date.today()` uses the server's local timezone. If `paid_at` is `timestamptz`, the database compares it in its session timezone. If those differ, invoices paid near midnight end up in the wrong day's file or in none. I can't see the schema, so this is a question for you: which timezone does finance mean by "yesterday"?

## Fine as is
The code is split into small functions (fetch, write, upload, run), the query is parameterised (no SQL injection risk), and the connection is closed in `finally`.

## What to do before merging
Fix items 1–3, add the tests, and get a decision on item 6. Items 4 and 5 are each a one-line change, so I'd include them too.

VERDICT: NOT READY
