equals-wd-card-expense-proc.../templates/eib
JasonFraser e339b7147a Move merchant mapping to a bind-mounted CSV, add in-UI mapping flow
MERCHANT_LOOKUP was a hardcoded dict in logic.py, so adding a merchant
meant editing Python and rebuilding the Docker image just to add one
row of data. Replaces it with:

- app/tools/eib/merchant_lookup.csv (raw_description,clean_name),
  bind-mounted in docker-compose.yml so edits (by hand or via the app)
  take effect on the next run — no rebuild, no restart.
- logic.py: _load_merchant_lookup() reads it fresh on every
  process_raw() call; add_merchant_mappings() rewrites it with new
  entries merged in.
- routes.py: new POST /api/merchant-mappings endpoint.
- templates/eib/index.html: the unmapped-merchant panel is now a form
  (raw name -> editable clean-name input per merchant, prefilled with
  the raw name) with a "Save & Continue Processing" button. Saving
  posts the mappings, then automatically resubmits the same in-browser
  File object to /api/process — no re-upload needed to resume.

Verified end to end: removed a known mapping to trigger the unmapped
path with zero rebuild (confirming the bind mount), saved it back via
curl, confirmed the CSV was updated on the host, and confirmed
reprocessing succeeded immediately after.

Also includes the user's own edits to eib_pre_template.xlsx and
planeterra_equals_cards_transactions_eib_v45.xlsx made directly in
Excel/Numbers outside this session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-19 11:55:43 -04:00
..
index.html Move merchant mapping to a bind-mounted CSV, add in-UI mapping flow 2026-08-19 11:55:43 -04:00