It is not ready to merge as written: four problems can each lose a night of finance data or leak customer emails. The fixes are small (roughly 30 lines plus tests), and the structure of the file is good, so it only needs additions, not a rewrite.

I reviewed by reading only; nothing was run. `test_export_job.py`, which the docstring cites, is not next to `export_job.py`, and I could not search other folders.

## Blocking

1. **A failed export looks like a success to cron (lines 56-57).** `run()` catches every exception, logs one line and exits with code 0. For example, if the finance endpoint returns 503 at 02:00, the job exits 0, no alert fires, and finance has no file. Log the traceback with `log.exception` and re-raise or `sys.exit(1)`.

2. **A missed day is never retried (line 47).** The date is always "yesterday" and cannot be overridden. If the 14 Nov export fails, the next run exports 15 Nov and the 14 Nov invoices are never sent. Add a `--date` argument so a day can be re-run.

3. **Every customer email is written to the log (line 52).** A night with 5,000 invoices puts 5,000 addresses in one log line, which then goes wherever logs are shipped and retained. Log the count only.

4. **The upload has no timeout (line 42).** `requests.post` waits forever by default. If the endpoint accepts the connection and never answers, the job hangs until the next night's run starts beside it. Add `timeout=(10, 120)` or similar.

## Should fix before merge

5. **Logging is never configured.** Run as a script, the `log.info` lines are dropped, so "export finished" appears nowhere and a good run is indistinguishable from one that never started. Add `logging.basicConfig(level=logging.INFO)` in the `__main__` block, after fixing item 3.

6. **The day boundary depends on two clocks that may disagree (lines 28, 47).** `date.today()` uses the cron host's timezone; the query window uses the database's.
   - **Example:** host on IST and database on UTC. The 02:00 IST run on 15 Nov happens at 20:30 UTC on 14 Nov and exports "14 Nov UTC", which has not ended.
   - **Result:** invoices paid between 20:30 and 24:00 UTC are never exported.
   - **Fix:** compute the window explicitly in one named timezone. I could not check your actual host and database settings.

7. **Amounts are divided by 100 for every currency (line 37).** A JPY invoice stored as 5000 (¥5,000) is exported as 50.0. Formatting is also inconsistent: 1000 cents becomes `10.0`, not `10.00`. Use `Decimal` with the per-currency exponent, or export `amount_cents` unchanged.

8. **Tests cover only the CSV header and one row.** Nothing tests the date window, a failed upload, the exit code or an empty day, which are the paths in items 1, 2 and 6.

9. **`FINANCE_UPLOAD_URL` is read at import time (line 16).** Importing the module without that variable raises `KeyError`, including in tests. Read it inside `upload()` or `run()`, as `DATABASE_URL` already is.

10. **The upload sends no credentials (line 42).** If the URL does not carry a token, anyone who can reach the endpoint can post to it. Confirm how finance authenticates this.

## Minor

11. **Spreadsheet formulas:** a `customer_email` starting with `=`, `+`, `-` or `@` runs as a formula when finance opens the CSV in Excel. Prefix such values with `'`.
12. **Files on disk:** the CSV files in `/var/exports` hold customer emails, are never deleted, and get default permissions. A failed run leaves a partial file.
13. **Null amounts:** one invoice with a NULL `amount_cents` raises `TypeError` and fails the whole night's export.
14. **Connection failures:** `psycopg2.connect` (line 49) sits outside the `try` and has no `connect_timeout`, so they behave differently from every other failure.
15. **Re-runs:** running the same day twice uploads the file twice. Check whether the endpoint de-duplicates.
16. **Empty days:** a day with no invoices still uploads a header-only file. Fine if finance expects it, but decide deliberately.
17. **Status changes:** an invoice paid yesterday and refunded before 02:00 is silently left out, because the query filters on current status.
18. **Encoding:** `open()` has no `encoding="utf-8"`, so the file encoding depends on cron's locale.
19. **Timestamps:** `paid_at.isoformat()` has no UTC offset if the column is a plain timestamp.
20. **Concurrent runs:** there is no lock against two runs overlapping.
21. **Style:** `row[1]` on line 52 is a magic index (it goes away with item 3), `EXPORT_DIR` is hard-coded, and there are no type hints.

Items 1-5 and 9 are a few lines each; item 8 is where most of the time goes.

VERDICT: NOT READY
