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-06-23-add-quote-attachments-direction.ts | ||
| 2026-06-23-add-quote-email-composition-fields.ts | ||
| 2026-06-23-add-quote-outbound-email-fields.ts | ||
| 2026-06-23-add-quote-template-fields.ts | ||
| 2026-06-26-add-orders-rep.ts | ||
| 2026-06-27-add-order-quote-match-fields.ts | ||
| 2026-06-27-drop-orders-status-and-wipe.ts | ||
| 2026-06-28-add-companies-coordinates.ts | ||
| 2026-06-28-add-purchase-order-pdfs.ts | ||
| 2026-06-28-convert-customer-fields.ts | ||
| 2026-06-30-add-price-list-search-text.ts | ||
| 2026-06-30-add-price-list-sku-normalised.ts | ||
| 2026-06-30-add-price-list-source-file.ts | ||
| 2026-06-30-add-pricelist-notes.ts | ||
| 2026-06-30-add-quote-items-sku-and-pricing.ts | ||
| 2026-06-30-add-raw-price-list.ts | ||
| 2026-06-30-backfill-price-list-search-text.ts | ||
| 2026-06-30-create-rfq-outbound.ts | ||
| 2026-07-02-add-sprint-categories-and-claims.ts | ||
| 2026-07-06-order-items-assigned-at.ts | ||
| 2026-07-06-order-items-collection-pool-rename.ts | ||
| 2026-07-06-order-items-nullable-numbers.ts | ||
| 2026-07-06-order-items-pricing-fields.ts | ||
| 2026-07-06-purchase-orders-documents-field.ts | ||
| 2026-07-06-purchase-orders-send-fields.ts | ||
| 2026-07-06-quote-attachments-quote-item-and-kind.ts | ||
| 2026-07-07-backfill-assigned-rfc.ts | ||
| 2026-07-07-order-items-collection-photo.ts | ||
| 2026-07-07-order-items-ready-for-collection.ts | ||
| 2026-07-09-po-additional-attachments.ts | ||
| 2026-07-09-po-pdf-tokens.ts | ||
| 2026-07-10-restore-counters.ts | ||
| 2026-07-14-create-stock-purchases.ts | ||
| 2026-07-14-create-stock.ts | ||
| 2026-07-15-add-stock-items-target-qty.ts | ||
| 2026-07-15-add-stock-line-drv-id.ts | ||
| 2026-07-15-stock-purchase-line-state.ts | ||
| 2026-07-16-add-stock-purchase-documents-history.ts | ||
| 2026-07-16-add-stock-purchase-send-statuses.ts | ||
| 2026-07-17-add-stock-purchase-problem-fields.ts | ||
| 2026-07-19-create-delivery-notes.ts | ||
| 2026-07-19-delivery-notes-signed-copy.ts | ||
| 2026-07-19-delivery-notes-v3.ts | ||
| 2026-07-20-delivery-tracking.ts | ||
| 2026-07-24-partial-approval.ts | ||
| 2026-07-25-add-ai-insights-fields.ts | ||
| 2026-07-26-fix-quote-counter-and-reassign-numbers.ts | ||
| 2026-08-03-add-stock-pricing-and-cost-history.ts | ||
| 2026-08-04-add-order-items-item-status-index.ts | ||
| 2026-08-04-add-quotes-status-index.ts | ||
| 2026-08-06-add-stock-purchase-booked-fields.ts | ||
| 2026-08-06-stock-purchases-additional-attachments.ts | ||
| 2026-08-07-flip-stale-unprocessed-items.js | ||
| 2026-08-07-renumber-duplicate-quotes.js | ||
| 2026-08-07-stock-purchase-items-catalogue-fields.ts | ||
| 2026-08-08-add-quotes-ai-status.ts | ||
| 2026-08-09-add-ai-settings.ts | ||
| 2026-08-09-add-ai-system-prompt.ts | ||
| 2026-08-09-backfill-quote-validity-days.ts | ||
| 2026-08-09-repair-stock-double-booking.ts | ||
| 2026-08-13-fix-delivery-notes-relations.ts | ||
| 2026-08-17-add-order-items-in-stock.ts | ||
| 2026-08-29-add-order-delivery-note-match-fields.ts | ||
| 2026-09-04-create-pos-slip-layouts.ts | ||
| 2026-09-09-add-quotes-attachment-fields.ts | ||
| 2026-09-09-fix-quote-attachment-fields-maxselect.ts | ||
| 2026-09-09-migrate-quote-attachments-to-fields.ts | ||
| _env-loader.ts | ||
| add-pos-sale-discount-fields.ts | ||
| add-quote-items-user-edited.ts | ||
| broaden-quote-attachments-mime-types.ts | ||
| create-order-items-v2-and-collection-pool.ts | ||
| create-quote-attachments-and-replies.ts | ||