Not ready to merge tomorrow as it stands. Three problems would hurt in production: failures are hidden from cron, every customer email gets written to the logs, and the test file the docstring mentions isn't in the folder. Each is a small fix. The overall shape is good: the functions are small and each does one job, the SQL is parameterised, the date range is half-open (`>=` / `<`), and the connection is always closed.

## Blockers

1. **A failed export looks like a success** (`export_job.py:56-57`). The `except Exception` logs the error and carries on, so the process exits with code 0. For example, if the finance endpoint returns a 500, `raise_for_status()` raises, the error is logged as one line, and cron records a clean run. Finance gets no file and nobody is alerted. `log.error` also drops the traceback. Fix: use `log.exception(...)`, then `raise` (or `sys.exit(1)`).

2. **Customer emails go into the logs** (`export_job.py:52`). `[row[1] for row in rows]` writes every customer's email into the INFO log every night. That puts personal data into log storage, which usually has wider access and longer retention than the database. Fix: log only the count and the day.

3. **The tests are missing, and the planned ones cover too little.** The docstring points to `test_export_job.py`, but no such file is in this folder. The coverage it describes (CSV header plus one row) doesn't test any of the failure handling. At minimum you need tests for:
   - a failed upload making the job fail
   - a day with no invoices
   - amount formatting
   - the start and end of the date range

## Should fix

4. **The upload has no timeout** (`export_job.py:42`). If the finance endpoint stops responding, `requests.post` waits forever, and the next night's cron run starts on top of the stuck one. Add something like `timeout=(5, 60)`.

5. **Amounts are converted with float division** (`export_job.py:37`). `amount_cents / 100` gives a float, and it assumes every currency has 2 decimal places. Two concrete cases:
   - A JPY invoice stored as `500` is exported as `5.0`, but should be `500`.
   - A KWD amount, which has 3 decimal places, is out by a factor of 10.
   
   If the job only ever handles 2-decimal currencies, document that. Otherwise use `Decimal` with the right exponent for each currency, or export the raw cents.

6. **The day boundaries depend on the server's timezone** (`export_job.py:47`). `date.today()` uses the server's local time, and Postgres then reads the naive date in the session's timezone. Suppose the server runs in UTC and finance works in IST: an invoice paid at 01:00 IST on the 14th lands in the 13th's export. Pick one timezone explicitly and pass timezone-aware datetimes as the boundaries.

7. **There's no way to re-run a past day.** `run()` always exports "yesterday". When an upload fails (and after fix 1 you'll find out when it does), you'll want something like `run(day)` or a `--date` argument to re-run that day.

8. **Logging is never configured.** Nothing calls `logging.basicConfig` when the script runs from cron, so the default WARNING level applies. Both `log.info` lines are silently dropped, which means the "export finished" line will never show up in the logs.

## Minor

9. **`FINANCE_UPLOAD_URL` is read when the module is imported** (`export_job.py:16`). If the variable isn't set, simply importing the module (in a test, for example) fails with `KeyError`. It's also inconsistent with `DATABASE_URL`, which is read inside `run()`. Read both in `run()`, or in one small config function.
10. **Empty days aren't handled explicitly.** On a day with no invoices, the job uploads a file with only the header row. That may be what finance wants, but confirm it and add a test for it.
11. **The CSV is written in place, not atomically.** If the job crashes mid-write, a partial `invoices-YYYY-MM-DD.csv` stays behind. Write to a temp file and rename it. The job also assumes `/var/exports` already exists.
12. **Exported files containing personal data are never cleaned up.** The CSVs, with emails in them, pile up in `/var/exports` with default permissions. Consider deleting each one after a successful upload, or adding a retention policy.
13. **Spreadsheet formula injection.** If finance opens the CSV in Excel, an email value starting with `=`, `+`, `-` or `@` can be run as a formula. The risk is low, but it's cheap to guard against.
14. **The `amount` header doesn't give units.** Something like `amount_major_units`, or a note to finance, would avoid confusion with `amount_cents`.
15. **No retry on upload.** A single network error fails the whole night. A small retry with backoff would help, provided the endpoint handles receiving the same file twice safely.
16. **No type hints or function docstrings.** This is purely a style point; it matters only if the rest of the codebase uses them.

Fixes 1, 2, 4 and 8 together are about ten lines of code. With those plus the tests from item 3, this would be in good shape to merge.

VERDICT: NOT READY
