**Not ready to merge as it stands.** Four problems can lose or corrupt finance data, or leak customer data, without anyone noticing. The structure is good (small functions, parameterised SQL, connection always closed), and the fixes are small, so tomorrow is still realistic if items 1–4 are fixed.

I read the file but did not run it, and I haven't seen `test_export_job.py` or the `invoices` schema. Items 3 and 4 depend on the column types.

## Blockers

1. **Failures are silent (lines 56–57).** The `except Exception` logs the error and returns, so the process exits 0 and cron sees success. For example, if the finance endpoint returns 503, no file is delivered and nothing alerts.
   - The module never configures logging, so the `log.info` lines go nowhere and a successful run is also invisible.
   - `log.error("%s", error)` drops the traceback.
   - Fix: use `log.exception` and re-raise (or `sys.exit(1)`), and call `logging.basicConfig` in the `__main__` block.

2. **A failed day is never exported (line 47).** The date is hardcoded to yesterday, with no retry and no way to pass a date. If the run on 14 Nov fails, the next run exports only 14 Nov and the invoices for 13 Nov never reach finance. Fix: accept an optional `--date` argument, and ideally retry the upload a few times.

3. **Customer emails are written to the log (line 52).** Every run logs the full list of customer emails for the day. That is personal data in log files, which usually have wider access and longer retention than the database. It also produces one very large log line on busy days. Fix: log only the count.

4. **Amounts are wrong for some currencies and inconsistently formatted (line 37).** `amount_cents / 100` assumes every currency has two decimal places.
   - A JPY invoice stored as `500` is exported as `5.0`; the expected value is `500`.
   - Float division gives `10.0` for 1000 cents and `10.5` for 1050 cents; the expected values are `10.00` and `10.50`.
   - Fix: use `Decimal` with a per-currency exponent, or export the raw minor units and name the column `amount_cents`.
   - If you only ever bill in two-decimal currencies, this reduces to the formatting problem.

## Should fix

5. **The "yesterday" window depends on two timezones (lines 28, 47).** `date.today()` uses the cron host's timezone, and the date is compared to `paid_at` in the database session's timezone. If the host is UTC and the session is US Eastern, an invoice paid at 23:30 Eastern on 12 Nov is missed or lands in the wrong file. Fix: build explicit timezone-aware start and end datetimes in the timezone finance reports in.

6. **The upload has no timeout (line 42).** `requests.post` without `timeout=` can hang indefinitely, and it holds the database connection open while it hangs. A hung job at 02:00 looks the same as a job that never ran.

7. **Reruns can send duplicates.** Running the job twice for the same day uploads the same invoices twice. Whether that matters depends on whether the finance endpoint de-duplicates by filename or invoice id; I can't tell from this file.

8. **Export files accumulate in `/var/exports` (lines 15, 33).** Each file holds customer emails and amounts and is never deleted, with permissions set by whatever umask cron has. A failure mid-write also leaves a partial file under the final name. Fix: write to a temp file, rename it, set mode `0o600`, and delete after upload or add a retention rule.

9. **Tests cover only the CSV header and one row.** Nothing tests the date window, the upload, the failure path or `run()`. Items 1, 4 and 5 are all reachable with small unit tests, and each fix above should arrive with one.

10. **`FINANCE_UPLOAD_URL` is read at import time (line 16).** Importing the module without the variable set raises `KeyError`, including from the test file. `DATABASE_URL` is read inside `run()`, so the two are inconsistent. Read both inside `run()`.

11. **The upload request carries no credentials (line 42).** If authentication is embedded in the URL or handled by the network, this is fine; otherwise the endpoint accepts anonymous uploads.

## Minor

12. **Spreadsheet formula injection (line 37).** An email beginning with `=`, `+`, `-` or `@` is treated as a formula if finance opens the CSV in Excel. Prefix such values with `'`.
13. **No explicit file encoding (line 33).** `open` uses the locale default, which under cron may not be UTF-8. Pass `encoding="utf-8"`.
14. **`paid_at.isoformat()` may omit the UTC offset (line 37).** If the column is `timestamp` without time zone, finance can't tell which timezone the value is in.
15. **A `NULL` `amount_cents` crashes the whole export (line 37).** One bad row raises `TypeError` and no file is sent for the day.
16. **Empty days upload a header-only file.** Probably fine, but confirm finance expects it rather than no file.
17. **`fetchall()` loads the whole day into memory (line 29).** Fine at normal volumes; a server-side cursor would remove the ceiling.
18. **No guard against overlapping runs.** A hung run (item 6) plus a manual rerun would both write the same path.
19. **`EXPORT_DIR` is hardcoded (line 15).** This makes the job awkward to run locally or in tests.
20. **No type hints or function docstrings.** The module docstring is good; this is a nit.

VERDICT: NOT READY
