diff --git a/README.md b/README.md index 3c76826..d74cfbf 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ Finance team tooling for **Utopia Brands**. The main (currently only) application is the **Amazon Accounts Receivable Aging Dashboard** — it turns the month's Amazon *Custom -Unified Transaction* exports into the month-end AR workbook, with per-user login, -month-end controls, exchange-rate fetching, and a full audit trail. +Unified Transaction* exports into the month-end AR workbook, with per-user login +(self-service password reset by emailed code), month-end controls, central-bank +exchange-rate fetching, and a full audit trail. ## Repository layout @@ -32,6 +33,7 @@ sample data (local) "Test Files/" — real Amazon exports; gitignored, never | Deploy to AWS | [ar-aging-app/deploy/DEPLOY.md](ar-aging-app/deploy/DEPLOY.md) (~$50–55/month) | | See how figures are calculated | [ar-aging-app/docs/system-guide.md](ar-aging-app/docs/system-guide.md) | | Read the production plan | [plan.md](plan.md) | +| Reset a forgotten password | login screen → "Forgot password?" (emailed code) — or admin: `manage.py set-password` | | Manage users / fix data | `python ar-aging-app/backend/manage.py --help` | Financial data never enters git: spreadsheets, databases, uploads, and `.env*` secrets are diff --git a/ar-aging-app/README.md b/ar-aging-app/README.md index 90c8f95..990da79 100644 --- a/ar-aging-app/README.md +++ b/ar-aging-app/README.md @@ -48,6 +48,10 @@ Key production behaviors: under another name is skipped. A month can never count a file twice. - **Login** (`AR_AUTH`) — per-user accounts via `manage.py add-user`; journal review/approval and FX confirmations record the signed-in user's verified name. +- **Password self-service** — users change or recover passwords with a 6-digit code emailed + to their account address (Settings, or "Forgot password?" on the login screen). Sent via + the company Mail API (`AR_MAIL_API_*`), SMTP fallback; `manage.py set-password` remains + the admin override. - **Exchange rates** — "Fetch month-end rates" pulls central-bank rates (Frankfurter, free, keyless; `AR_FX_PROVIDER`); fetched rates still require human confirmation (Control C5). - **Completed closings are locked** read-only; corrections need an explicit Reopen. @@ -73,11 +77,11 @@ scripts\start.bat # or: powershell -ExecutionPolicy Bypass -File scripts\sta # macOS one-click: scripts/start.command ``` -Then open http://localhost:5173 → **New Closing** → pick the month → drag in the three Amazon +Then open the dashboard → **New Closing** → pick the month → drag in the month's Amazon files → **Run processing** → review → **Download Full A/R Aging Excel**. -Uploads and exports are stored under `AR_DATA_DIR` (default `backend/data` locally, `/data` in Docker). -The app connects to MySQL using `MYSQL_*` variables from `.env`. +Uploads and exports are stored under `AR_DATA_DIR` (default `backend/data` locally, `/data` in +Docker). The database is a local SQLite file by default; set `MYSQL_*` in `.env` to use MySQL. ## Run the engine headless (CLI) ```bash @@ -90,21 +94,28 @@ python cli.py "/path/USA…01 to 10 January,2026.xlsx" \ ## Tests ```bash -make test # 16 fast tests (engine, export, API, robustness) +make test # 155 fast tests: engine, API, auth, FX, upload dedup, month locking make test-all # + Jan-2026 reconciliation & sample-comparison (integration, ~4 min) -# point tests at the sample files if not in the repo root: +# point the integration tests at the sample files if not in the repo root: AR_SAMPLE_DIR="/path/to/samples" make test-all ``` +The suite runs against an isolated temporary database — it can never touch real data +(a session-scoped guard asserts the isolation before anything runs). -## Status — all phases complete (incl. v2 multi-market) -- ✅ **Engine** — settlement classification + receivable; USA = **11,110,433** verified to the penny -- ✅ **Multi-marketplace** — all 13 markets (CA/UK/AU/IE + localized FR/DE/IT/ES/NL/PL/SV/TR) - reconcile **to the penny** vs the Jan-26 workbook; per-market currency & FX; settlement-owner - logic for cross-market EU chains; helper-row & pivot-sheet detection -- ✅ **AR roll-forward** — opening balance (auto carry-forward) + net revenue − payouts = closing; - AR Ledger · Finance Summary · Journal Entry (per-marketplace) · Reconciliation Control w/ sign-off -- ✅ **Header mapping** — localized alias tables + admin rules UI (`/api/mapping-rules`); unmapped - amounts are never silently excluded -- ✅ **Storage-fee detection** — canonical + description-based (potential/missing storage exceptions) -- ✅ **Excel** — Full audit workbook + Summary Finance pack -- ✅ **Tests** — ~60 fast + integration (USA reconciliation, sample comparison, 13-market benchmark) +## Feature summary + +**Calculation engine** +- Settlement classification + receivable; USA Jan-26 = **11,110,433** verified to the penny +- All 13 marketplaces reconcile to the penny vs the Finance workbook — per-market currency + & FX, settlement-owner logic for cross-market EU chains, helper-row/pivot-sheet detection +- AR roll-forward (opening + net revenue − payouts = closing) with auto carry-forward, + AR Ledger, Finance Summary, per-marketplace Journal Entry, Reconciliation Control +- Header mapping with localized alias tables + admin rules UI; unmapped amounts are never + silently excluded; storage-fee detection; full Excel audit workbook + Finance pack + +**Operations & security** +- Per-user login with emailed password codes; verified names on every sign-off +- Six month-end controls (C1–C6) block publication of any untrusted figure +- Month-end FX fetched from central-bank data, gated by human confirmation +- Duplicate-proof uploads, one-closing-per-month guard, completed-month locking +- Production Docker stack (auto-HTTPS · MySQL · nightly S3 backups) + Gitea Actions CI