**The structure is good.** Query, CSV writing, upload and orchestration are separate small functions, the query is parameterized, and the connection is closed in `finally`. Two things need fixing before you merge, and the rest are small.

## Must fix before merge

1. **Failures are silent (`export_job.py:56-57`).**
   - `run()` catches every exception, logs it, and exits 0. Cron sees success, so nothing alerts anyone.
   - Example: the finance endpoint returns a 500 at 02:00. Expected: a non-zero exit and an alert. Actual: one `export failed` log line and exit 0, so finance finds out when the file is missing.
   - Fix: log with `log.exception(...)` and re-raise, or call `sys.exit(1)`.

2. **Customer emails are logged (`export_job.py:52`).**
   - The info log prints `[row[1] for row in rows]`, which is every customer email for the day.
   - That puts personal data into log files that are usually retained and widely readable. A busy day also makes a huge log line.
   - Fix: log only the count and the date.

3. **The upload has no timeout (`export_job.py:42`).** `requests.post` waits forever by default, so a stalled endpoint leaves the 02:00 job hanging, and tomorrow's run can overlap with it. Fix: add `timeout=30` or similar.

## Should fix

4. **Day boundaries depend on timezones.** `datetime.date.today()` uses the server's timezone, and `paid_at` may be timezone-aware or stored in UTC. If the server is in UTC and finance expects local business days, invoices paid late in the evening land in the wrong file. Decide which timezone defines "yesterday" and make it explicit.

5. **Money is a float (`export_job.py:37`).**
   - `amount_cents / 100` writes `10.0` for 1000 cents, not `10.00`.
   - It also assumes every currency has two decimal places. JPY has none, and KWD has three.
   - Fix: use `Decimal` with a per-currency exponent, or export the integer cents column as-is.

6. **The tests are too thin.** The docstring says they cover only the CSV header and one row. Nothing covers an empty day, the date boundaries, an upload failure (which would have caught problem 1), or the zero-padded amount format.

7. **Reruns are not safe.** A rerun overwrites the local file and uploads again. If the endpoint doesn't deduplicate by filename, finance gets duplicates. At minimum, confirm how the endpoint behaves.

## Minor

8. **`UPLOAD_URL = os.environ[...]` runs at import time (`export_job.py:16`).** Importing the module without the variable set raises `KeyError`, so tests need the environment set. Read it inside `run()`.

9. **Spreadsheet formula injection.** A `customer_email` that starts with `=`, `+`, `-` or `@` can run as a formula when finance opens the CSV in Excel. This is low risk for emails but cheap to guard against.

10. **No logging setup.** There is no `logging.basicConfig`. Under cron, `log.info` lines are dropped (only warnings and above reach stderr), so the "export finished" message never appears.

11. **The file is written straight to its final path.** A crash mid-write leaves a truncated CSV that could be picked up later. Write to a temp file, then `os.replace`.

12. **The exported file stays on disk.** It contains customer emails, is created with default permissions, and `EXPORT_DIR` is hardcoded and never created. Decide on retention and permissions, and make the directory configurable.

13. **Empty days still upload a header-only file.** This may be what finance wants, but it should be a deliberate choice, ideally with a test.

14. **`fetchall()` loads every row into memory.** This is fine at current volume and only matters if volume grows a lot.

15. **`paid_at.isoformat()` fails on `None`.** If a `PAID` invoice ever has a null `paid_at`, the whole export fails, and with problem 1 it fails silently.

Items 1 to 3 are each a few lines. Item 6 is where I'd spend the most time, because a failure-path test for the upload would catch problem 1 on its own.

VERDICT: READY WITH CHANGES
