2026-08-19 12:57:27 +00:00
<!-- BEGIN:nextjs - agent - rules -->
feat(cash-floats): petty-cash cards on users, one log, clock Slips tab
Each cash float card lives on its holder's user record (card number, last
4-6 digits of the physical card, low limit, assigned date). Every movement
goes in one cash_float_log collection: opening, top-up, slip, handover and
correction rows with signed amounts. Balances are always summed from the log.
- Management -> Cash Floats: cards table (lowest balance first), add, edit,
top up, hand over, correct balance, retire, movements sheet with slip
photos and CSV export. Admin-only.
- Settings -> Users: card section in the edit form and the balance per holder.
- Clock app: Slips tab, shown only to a user who holds a card. Photo, site,
supplier and amount; the slip comes off that user's own card.
- Sidebar needs-attention mark when a card is under its limit.
- Slips count as site spend ("Cash float slips" on the site page).
- Migration scripts/migrations/2026-10-24-cash-floats.py (already applied to
production on 2026-10-24).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:17:06 +00:00
# This is NOT the Next.js you know
2026-08-19 12:57:27 +00:00
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js` . Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
<!-- END:nextjs - agent - rules -->
2026-10-28 21:18:24 +00:00
## PO email intake
Purchase orders that arrive by email in `ai@megainfra.co.za` are filed into the dashboard by the
n8n workflow **MEGA - PO Email Intake (Microsoft Outlook)** (`gpKjNsXoqNUzsMb4`).
Two rules that must not be dropped:
1. **Check for a duplicate before filing anything.** Two checks: the same document at the same
site (file hash + site → archive the mail, file nothing), and the PO number already in the
system (read from the attachment filename or subject, e.g. `MEGCPO9524.pdf` → tag
`PO Duplicate` and leave it for a human). The app re-checks both after OCR in
`/api/purchase-orders/process-batch` (`po_number_conflict`).
2. **Move processed mail out of the inbox.** A successful filing is tagged `PO Ingested` and
moved to Archive; `PO Duplicate` and `PO Needs Review` stay in the inbox for review and are
skipped on later runs.
Full runbook and workflow source: `docs/n8n/po-email-intake.md` and
`docs/n8n/po-email-intake.workflow.js` .