WFDASH-WEBAPP/docs
Dave cd359b75a9 feat(quotes): split attachments into internal vs outbound with operator upload UI
Splits the quote attachment model along the seam that actually matters:
'operator-only references' (drawings the operator consulted, supplier
emails they filed away) vs 'customer-facing files' (supplier quotes,
drawings, NDAs that need to ride along on the email).

Schema (PB): new `internal_attachments` + `outbound_attachments` fields
on the `quotes` collection, maxSelect 10 each. Existing `attachments`
field kept for back-compat but is no longer the source of truth for
outbound emails.

API:
- GET/POST/DELETE /api/v1/quotes/[id]/internal-attachments[/{filename}]
- GET/POST/DELETE /api/v1/quotes/[id]/outbound-attachments[/{filename}]
- POST /api/v1/quotes/[id]/attachments/upload kept for legacy `attachments`

MCP: `quotes.send_email` description now correctly states
`selectedAttachmentIds` are PB file tokens from `outbound_attachments`
(supplier quotes, drawings, NDAs), not IDs of the legacy `attachments`
collection.

Frontend: `ProcessOutboundAttachmentsCard` component lets the operator
upload/remove customer-facing files during the process page; approval +
process pages now read the new fields.

Outbound Send workflow (deployed as `PIEAkPYYYZLGl6Pj`):
- Old workflow (id `WF_Email_Send_SMTP`) and stale repo file
  (`WFDASH — Quote Outbound Send.json`) replaced.
- New revision intersects `quotes.outbound_attachments` with
  `email_outbound_attachment_ids`, downloads each from
  `/api/files/quotes/<id>/<token>`, and emits
  `options.attachments: [{name, content, type}]` consumed by
  `Send Email (SMTP)` (PO Send pattern).
- Failure path flipped from `send_failed` to `mail_failed` so
  `retryQuoteEmail` can find failed sends (it only accepts the
  latter). Previously failed sends were stranded.

Email Monitor (v5) workflow fixes:
- Reply-branch auth: any authenticated request now passes through;
  pre-fix bug rejected branches that the IMAP trigger hadn't seen yet.
- Reply detection: bulletproof subject regex
  (/Q-?\d{4}-?\d{2}-?\d{3}/) accepts both legacy `Q-2026-09-246`
  and current `Q202609246` formats; canonicalised digits-only for
  PB `~` substring match.

Delivery notes: new pricing endpoint at
/api/v1/delivery-notes/items/[id]/pricing + service-layer methods.

Snapshots kept for forensics: PRE-FIX-REPLY-{BRANCH-AUTH,DETECTION}.json
and push-payload.baseline.json are the previously-deployed workflow
shapes, retained so we can diff/rollback if regression hits.

Verified:
- PUT workflow PIEAkPYYYZLGl6Pj -> 200, active, 25 nodes
- quotes-service.test.ts: 117 pass (4 pre-existing failures unchanged)
- mcp/route.test.ts: 118 pass (2 pre-existing failures unchanged)
- node --check on new Code node JS passes

Docs: docs/quotes-outbound-attachments-deploy.md covers the deploy
procedure; docs/api-mcp-layer.md description sync.
2026-09-09 13:43:56 +02:00
..
agents docs(hermes): bump tool count + add 'three quote-creation tools' callout 2026-08-27 07:50:17 +02:00
api-reference feat(quotes): add person_hint for customer resolution in forwarded emails 2026-08-27 11:11:44 +02:00
audit feat(quotes): enhance search functionality and user experience 2026-08-28 20:13:44 +02:00
bugs docs(bugs): add post-mortem for MCP initialize handshake bug 2026-08-05 01:53:02 +02:00
example-quotes feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
pocketbase feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
sops refactor(sops): streamline SOP documents for roles, consolidating content into quickstart guides for easier reference 2026-09-03 17:57:49 +02:00
superpowers feat(rep-visits): FleetAI tracker adapter, nearby-customer matching, stop detection 2026-09-06 14:22:28 +02:00
theme-preview feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
0136daf3-3ebd-4bca-876e-316271a40303.jsonl feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
AGENT_INSTRUCTIONS.md feat: add split-invoice stock PO workflow and supporting tooling 2026-08-07 00:53:29 +02:00
api-mcp-layer.md feat(quotes): split attachments into internal vs outbound with operator upload UI 2026-09-09 13:43:56 +02:00
core-recheck-matrix.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
counter-pwa.md feat(counter): add standalone counter order PWA 2026-08-13 09:27:20 +02:00
deliveries-n8n-workflow.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
dev-guide.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
django-nextjs-parity-backlog.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
driver-app-data-source.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
migration-audit.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
n8n-ai-insights-prompt.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
n8n-mcp-setup.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
n8n-watchdog-agent-instructions.md fix(quotes-intake): clamp email_body to PB's 5000-char cap 2026-09-08 10:28:20 +02:00
order-items-schema-standard.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
order-workflow-rules.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
orders-first-rollout.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
pricelist-extraction.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
qa-review.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
qa-review.verify.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
quotes-email-monitor.md feat(quotes): resolve customer from person_hint when rep forwards email 2026-08-27 10:45:51 +02:00
quotes-outbound-attachments-deploy.md feat(quotes): split attachments into internal vs outbound with operator upload UI 2026-09-09 13:43:56 +02:00
SHIPPED.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
tv-dashboard.md feat(tv-dashboard): enhance TV dashboard with driver stops and performance metrics 2026-08-19 10:16:49 +02:00
wfdash-v5-deployment.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00