The job isn't ready to merge tomorrow. Three things block it. When it fails, nobody finds out. It writes every customer's email address into the logs. And the tests its docstring mentions don't exist. All three are small fixes, so a fixed version could still go in tomorrow.

## Blockers

**1. Failures are hidden (High).** `export_job.py:56-57` catches every exception, logs one line, and returns normally. So the process exits with code 0 and cron treats the run as a success.
- **Example:** the finance endpoint returns a 500 at 02:00. `raise_for_status()` raises, the error gets logged, and the exit code is still 0. Finance gets no file, no alert fires, and no one notices until finance asks.
- **Fix:** log the error, then re-raise it (or call `sys.exit(1)`) so cron and your monitoring see the failure.

**2. Customer emails go into the logs (High).** `export_job.py:52` logs `[row[1] for row in rows]`, which is the full list of `customer_email` values for the day. That is personal data going into a place with weaker access control and longer retention than the database.
- **Fix:** log only the count.

**3. The tests don't exist (High).** The docstring says the job is tested by `test_export_job.py`, but there's no such file in this directory. Even if the file exists elsewhere, "CSV header and one row" leaves most of the job untested. Missing cases:
- the upload fails and the job must exit non-zero
- a day with no invoices
- the day boundaries (an invoice paid at 23:59:59 vs. one paid at 00:00:00)
- how amounts are formatted

`UPLOAD_URL` is read when the module is imported (`:16`), so even importing the file in a test fails unless that environment variable is set. Move it into `run()` or `upload()` so the file can be tested.

## Should fix before or soon after merge

| # | Severity | Line | Problem | Concrete case | Fix |
|---|---|---|---|---|---|
| 4 | Medium | 37 | Amounts are divided by 100 as floats, whatever the currency | A JPY invoice with `amount_cents=500` (¥500) exports as `5.0`. A KWD invoice (3 decimal places) is off by 10x. | Use `Decimal` with each currency's number of decimal places, or export the integer `amount_cents` and let finance convert. |
| 5 | Medium | 42 | `requests.post` has no timeout | If the endpoint stops responding, the job hangs indefinitely and the next night's run can overlap with it | `timeout=(5, 60)`, plus a retry with backoff if you want resilience. |
| 6 | Medium | 47, 28 | "Yesterday" means midnight in the server's local time, compared against `paid_at` in the database session's timezone | Server on UTC, finance working in IST: an invoice paid at 01:00 IST lands in the wrong day's file | Pick one business timezone and build timezone-aware start and end timestamps. |
| 7 | Medium | 47 | The date is hard-coded to "yesterday", so a failed night can't be re-run | The 02:00 run on Nov 14 fails. On Nov 15 there is no way to export Nov 13 without editing the code. | Accept an optional `--date` argument. |
| 8 | Low | 33, 48 | The CSV holds customer emails in `/var/exports`. It's created with default permissions and never deleted. If the upload fails, the file stays there. | — | Set `0o600` permissions and delete the file after a successful upload (or apply a retention policy). |
| 9 | Low | 62-63 | Logging is never configured, so the `log.info` lines never appear (Python only shows warnings and errors by default) | You'll see no "export finished" line, even after a successful run | Call `logging.basicConfig(level=logging.INFO)` in `__main__`. |
| 10 | Low | 29 | `fetchall()` loads the whole day into memory | Fine at today's volumes. It becomes a risk if invoice volume grows a lot. | Iterate the cursor directly, or use a named (server-side) cursor. |

## Good as is

The SQL is parameterised. The connection closes in `finally`. The date window is half-open (start inclusive, end exclusive), so no invoice falls into two days. The functions are small, each with one job.

## Suggested path for tomorrow

Fix items 1, 2 and 3, and make `UPLOAD_URL` load lazily. Add the timeout (item 5); it's one line. If items 4, 6 and 7 can't fit, merge without them, but open tickets now. Item 4 matters most among those: it gives finance wrong numbers for any currency that doesn't use two decimal places.

VERDICT: NOT READY
