**No, it's not ready to merge.** The biggest problem: if anything goes wrong, the job fails silently. On top of that, it writes customer emails into the logs, and the test file its docstring mentions doesn't exist.

## Must fix before merge

**1. Failures are hidden (`export_job.py:56-57`).** `run()` catches every exception, logs one line and returns normally, so the process exits with code 0.
- Example: the finance endpoint returns 500 on Tuesday night. `raise_for_status()` raises, the handler swallows it, and cron sees a successful run. Finance gets no file and nobody is alerted.
- Expected: the process exits with a non-zero code so cron or monitoring notices.
- Fix: use `log.exception(...)` (it keeps the traceback) and then re-raise, or call `sys.exit(1)`.

**2. Customer emails go into the logs (`:52`).** `[row[1] for row in rows]` logs every customer's email address at INFO level every night. That's personal data spreading into log storage, with whatever retention and access rules apply there. Log the count only.

**3. No tests.** The docstring says it's "Tested by test_export_job.py", but that file isn't in the directory. Even as described (a CSV header and one row), it wouldn't cover the risky paths. At minimum I'd want tests for:
- an upload failure, which should make the process exit non-zero
- a day with no invoices (right now that uploads a file with only the header row; is that what finance expects?)
- formatting of the amount column (item 4)
- the date window (item 6)

To make the code testable:
- Move `UPLOAD_URL` out of module level, so importing the module doesn't fail with a `KeyError` when the env var isn't set.
- Pass the date in as a parameter instead of calling `date.today()` inside `run()`.

**4. Amounts are calculated with floats and assume every currency has 2 decimal places (`:37`).**
- Example: an invoice for 1000 cents comes out as `10.0`, not `10.00`.
- Example: a ¥500 JPY invoice stored as `amount_cents=500` comes out as `5.0`. Currencies with 3 decimal places, like KWD, are also wrong.
- Since the query includes a `currency` column, I assume the data has more than one currency.
- Fix: use `Decimal` with the number of decimal places for each currency, or send integer minor units and tell finance that's the format.

**5. The upload has no timeout (`:42`).** If the endpoint hangs, the job hangs forever and the next night's run starts on top of it. Add something like `timeout=(5, 60)`.

## Should fix (could be a follow-up if you note it)

**6. Time zones.**
- `date.today()` uses the server's local time.
- Postgres compares `paid_at` against those dates using its own session time zone.
- If the two differ, or finance means "yesterday" in a different zone, payments made near midnight land in the wrong day's file.

Please confirm what time zone "yesterday" means for finance, and use that zone explicitly in the query.

**7. No way to re-run a missed day.** The day is always "yesterday". If Tuesday's export fails and you re-run it on Thursday, you get Wednesday's data. Add an optional `--date` argument. Also find out whether uploading the same file twice creates duplicates on finance's side.

**8. Logging is never set up.** Nothing in `__main__` configures logging, so INFO lines are dropped and only the error reaches stderr. Call `logging.basicConfig(...)` there.

**9. CSV files are never cleaned up.** The files in `/var/exports` contain customer emails and stay there indefinitely. Decide how long to keep them, or delete each one after a successful upload.

For tomorrow, items 1–5 are the blocking list. Each is a small change, but item 3 means writing the tests from scratch.

VERDICT: NOT READY
