**Not ready to merge tomorrow as written.** Two problems need fixing first: a failed export looks like a success, and customer emails are written to the logs. Both fixes are small.

I read `export_job.py` only. I couldn't see `test_export_job.py`, so my test comments rely on the docstring ("CSV header and one row").

## Must fix before merge

**1. High: failures are swallowed, so a missed export is silent.**
- `run()` catches every `Exception`, logs one line, and exits 0 (`export_job.py:56-57`).
- Example: the finance endpoint returns a 500 at 02:00. `raise_for_status()` raises, the job logs "export failed" and exits cleanly. Cron sees success, nothing alerts, and finance has no file for that day.
- Expected: a non-zero exit, so cron or monitoring can alert.
- Fix: re-raise after logging, and use `log.exception` so the traceback is kept (the current `log.error` drops it).

**2. High: customer emails are logged.**
- Line 52 logs `[row[1] for row in rows]`, the full list of customer emails, on every run.
- That puts personal data in log files that are usually retained and widely readable.
- Fix: log the count and date only.

**3. High: the tests don't cover the failure paths.**
- Per the docstring, the only test checks the CSV header and one row.
- Nothing covers an empty day, upload failure, DB failure, the date window, or amount formatting.
- Items 1 and 4 would each need a test, so this gap is also why they could ship unnoticed.
- Minimum for tomorrow: tests for "upload fails, so `run()` raises", "empty day", and the amount and date cases below.

## Should fix (can be a follow-up if you name the debt)

**4. Medium: money is formatted with float division.** `amount_cents / 100` writes `10.5` instead of `10.50`, and it can produce float artifacts. It also assumes every currency has 2 decimals, so a JPY invoice of 500 would export as `5.0` instead of 500. Use `Decimal`, or export the raw cents as an `amount_cents` column. Check with finance which they expect.

**5. Medium: the upload has no timeout.** `requests.post` without `timeout=` can hang forever, and the 02:00 cron run would then sit stuck. Add `timeout=30` or similar.

**6. Medium: "yesterday" depends on the server's timezone.** `date.today()` uses the host's local time, and `paid_at` is compared against bare dates. If the host runs in UTC but finance means local business days, invoices near midnight land in the wrong file. I can't tell the intended timezone from the file, so please confirm it. Then pass the day explicitly (also helpful for re-runs) and use timezone-aware bounds.

**7. Medium: `UPLOAD_URL` is read at import time (line 16).** If `FINANCE_UPLOAD_URL` is unset, `import export_job` raises `KeyError`, which breaks tests and tooling. Read it inside `run()` like `DATABASE_URL`.

## Minor

- **8. Low:** `EXPORT_DIR` is hard-coded to `/var/exports`, and nothing checks that it exists. The CSV with customer emails stays on disk with default permissions and is never cleaned up. Make the directory configurable, and set a retention or permissions policy.
- **9. Low:** CSV formula injection. A `customer_email` value starting with `=`, `+`, `-` or `@` could run as a formula if finance opens the file in Excel. This is unlikely for emails, but it is cheap to sanitize.
- **10. Low:** logging is never configured in this file, so `log.info`/`log.error` may go nowhere under cron. Confirm that the entry point sets up logging.
- **11. Low (structure):** `run()` mixes date logic, DB connection, and orchestration. Passing `day` and the connection in would make the tests in item 3 much easier to write.

## Fastest path to merge

Fix items 1, 2 and 5 (about ten lines), add the three tests in item 3, and confirm the timezone and decimal questions (items 4 and 6) with finance. Log items 4, 6, 8 and 9 as tracked follow-ups if the deadline is tight. That is an explicit, named debt, not a silent one.

VERDICT: NOT READY
