docs(agents): record the PO duplicate check and filed-label rules
This commit is contained in:
parent
844918da0d
commit
824271cdd0
1 changed files with 19 additions and 0 deletions
19
AGENTS.md
19
AGENTS.md
|
|
@ -7,3 +7,22 @@ This version has breaking changes — APIs, conventions, and file structure may
|
|||
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 -->
|
||||
|
||||
## 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`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue