**Not ready to merge as written, but the blockers are small and should be fixable before tomorrow.** The structure is good: query, CSV writing and upload are separate functions, and the SQL is parameterized. Two problems would hurt in production, though, and they come first.

## Blockers

1. **Failures are swallowed, so cron never learns the job failed.** `run()` catches every `Exception` (`export_job.py:56-57`), logs one line and exits 0.
   - If the database is down or the upload returns a 500, finance gets no file and nothing alerts anyone.
   - The fix is to use `log.exception(...)` and re-raise, or call `sys.exit(1)`, so cron sees the failure.
2. **Customer emails are written to the logs.** `export_job.py:52` logs `[row[1] for row in rows]`, which is every customer's email address, every night, in plain log files.
   - It is personal data in a place with weaker access controls than the database.
   - The fix is to log only the count and the date.

## Should fix (medium)

3. **Date boundaries depend on the server's timezone.** `datetime.date.today()` uses the server's local zone, and the date is compared to `paid_at` using the database session's timezone. On a UTC server with a non-UTC `paid_at` column, invoices near midnight can land in the wrong day's file or be exported twice.
   - For example, an invoice paid at 23:30 local time on the 13th may fall in the 14th's window.
   - Pick one zone (probably UTC) and use it on both sides.
4. **Money is converted with float division.** `amount_cents / 100` (`export_job.py:37`) produces floats.
   - Whole cents mostly print fine, but it is the wrong type for finance data.
   - Currencies without two decimals, such as JPY (0) or KWD (3), come out wrong: 500 yen is exported as `5.0`.
   - Use `Decimal` with a per-currency exponent, or export the integer cents and call the column `amount_cents`.
5. **The upload has no timeout.** `requests.post(...)` with no `timeout=` can hang forever, and the 02:00 cron job would stall silently. Add something like `timeout=30`.
6. **The tests are thin.** The docstring says they cover the CSV header and one row.
   - Untested: an empty day, a failed upload (see item 1), the day-boundary logic (item 3), and non-two-decimal currencies (item 4).
   - Adding tests for items 1, 3 and 4 as you fix them covers most of the gap.
7. **A missing env var fails at import time.** `os.environ["FINANCE_UPLOAD_URL"]` at module level (`export_job.py:16`) raises `KeyError` when the file is imported.
   - Tests must set the variable before importing, and the error message is unhelpful.
   - Read it inside `upload()` or `run()`, as `DATABASE_URL` already is.

## Minor

8. **A re-run is not clearly safe.** If the upload failed after the file was written, re-running overwrites the file and re-uploads. That is probably fine, but only if the finance endpoint de-duplicates by filename. Worth confirming with them.
9. **An empty day uploads a header-only file.** That may be what finance wants, but it should be a deliberate choice, with a comment or a test.
10. **No retry on transient upload errors.** A single network blip fails the whole night. A simple retry with backoff would help once item 1 makes failures visible.
11. **Spreadsheet formula injection.** A value starting with `=`, `+`, `-` or `@` is read as a formula if finance opens the CSV in Excel. The risk is low for emails, but it is cheap to guard against.
12. **`EXPORT_DIR` is hardcoded and never created or cleaned.** `/var/exports` must already exist, and old files, which contain customer emails, pile up. Make the directory configurable, create it if missing, and add a retention policy.
13. **The export file's permissions are not set.** It contains personal data, so consider creating it with mode `0600`.
14. **There is no `logging.basicConfig`.** Unless cron or a wrapper configures logging, `log.info` output is dropped. Only warnings and errors appear, through Python's last-resort handler.
15. **`fetchall()` loads everything into memory.** That is fine at current volume. Note it if invoice counts grow.

## Suggested order

Fix 1 and 2 first (minutes of work), add tests for them, then 3 to 5. The rest can follow as separate small changes if you want to hold to tomorrow.

VERDICT: NOT READY
