Five new fields on the `orders` collection: - potential_delivery_note (relation → delivery_notes, single) — the DN whose items exactly matched this order's items - potential_delivery_note_number (text) — denormalized copy of the matched DN's delivery_note_number, written alongside the relation so the orders list can render the number without a second `expand` (PB issues a separate IN query per expanded relation — orders-service.ts:253 documents why this is avoided here) - delivery_note_match_confidence (number) — always 1 when set, kept for shape parity with quote_match_confidence - delivery_note_match_method (text) — 'exact_items' or 'no_match', text not select for the same forward-compatibility reason quote_match_method is text - delivery_note_matching_attempted (bool) — audit flag Idempotent — each step detects its own 'already done' state. Verified by re-running after the first apply. Plan-staleness fix: PB stores relation options FLAT at the top level of the field object (collectionId / cascadeDelete / minSelect / maxSelect), not nested under an `options` key. The plan's snippet had the nested form and PB rejected it with 'fields.N.collectionId Cannot be blank.' Verified the correct shape against the live orders.potential_quote field before fixing. Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __pycache__ | ||
| dev | ||
| migrations | ||
| perf | ||
| smoke | ||
| utils | ||
| 2026-08-03-load-husqvarna-cart.ts | ||
| 2026-08-03-load-yg1-quote-soq078608.ts | ||
| 2026-08-03-merge-yg1-drafts.ts | ||
| 2026-08-13-heal-item-intel.ts | ||
| 2026-08-21-backfill-order-duplicates.ts | ||
| _env.ts | ||
| audit-pb-fields.py | ||
| backfill-item-intel.ts | ||
| backfill-po-items.mjs | ||
| build_v5_workflow.py | ||
| deploy_v5_to_n8n.py | ||
| import-data.ts | ||
| mcp-doc-gen.py | ||
| mrbxnim4-telegram-cloud-photo-size-4-6016860144018328845-y.jpg | ||
| n8n-v2-error.ts | ||
| n8n-v2-main.ts | ||
| quotes.pb.js | ||
| regenerate-delivery-note-pdfs.ts | ||
| seed-gielie-quotes.py | ||
| setup-pocketbase.ts | ||
| verify_v5.py | ||