Commit graph

10 commits

Author SHA1 Message Date
DEls
31fbc52c4d chore: 410 the old ocr-result route and archive its workflow export 2026-09-17 15:31:29 +02:00
DEls
49b6547c0c docs(n8n): rewrite for the two-node tick workflow 2026-09-17 15:23:16 +02:00
DEls
6cee861c3e chore: final review polish (trailing newlines, JSDoc, changelog tense) 2026-09-17 12:49:37 +02:00
DEls
8d1b5a6db7 docs(n8n): note the disconnected split branch pending the inbox pipeline 2026-09-17 12:42:44 +02:00
DEls
f184776148 docs(n8n): repoint PO ingest workflow at purchase_orders
Task 15 of the ingestion restructure. Edited the live n8n workflow
(005iI4jX5mq9DsTR) directly via MCP and published the new version.

Repointed Watchdog: List Stuck, Watchdog: Reset Stuck Rows, Fetch Pending
Batches, Atomic Claim, Claim Successful?, Download File and Escalate
Failure from data_import_batches/status onto purchase_orders/
processing_status. Verified zero in-flight rows would be orphaned: all
26 old purchase_orders-type batches were already processed or failed,
and all 24 real PO rows had processing_status unset (won't match the new
pending filter).

Two things found on the live workflow that the plan didn't anticipate:

- Atomic Claim had no ?filter=processing_status="pending" guard at all --
  an unconditional PATCH, despite the workflow's own name and this doc's
  prior description both calling it "atomic". Added while repointing the
  same node.
- Build Callback Payload sent the extracted PO number as `po_number`.
  process-batch's validator requires the field named exactly
  `purchase_order_number` -- the old field name would have failed
  validation on every single real upload, a total silent outage. Fixed
  before publishing, verified against the route's actual validateExtracted().

Also removed the n8n-side duplicate short-circuit: the old
Build Callback Payload queried purchase_orders and PATCHed the batch row
directly from n8n code to pre-empt process-batch's own dedup logic.
process-batch's merge branch (Task 14) already does this correctly,
server-side, tested. Keeping both meant the same decision made twice in
two places that could disagree. Is Duplicate? node removed; Build
Callback Payload connects straight to Send Callback.

Published as the active version and verified by reading the workflow
back in full -- every repointed node confirmed, connections confirmed,
zero validation warnings.

Rewrote docs/n8n/purchase-order-ingest-implementation.md end to end to
describe the deployed shape rather than the retired one. Flagged (not
fixed, separate decision) a plaintext PB superuser password baked into
the Auth PB Admin node.

Marked Tasks 1-15 complete in the plan's own checkboxes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 14:46:57 +02:00
DEls
8dbf393446 feat(delivery-notes): enhance delivery note upload and processing
- Updated the delivery note upload API to include site ID for better project association.
- Modified the delivery note schema to support additional fields such as processing status, OCR confidence, and received by name.
- Enhanced the UI components for uploading delivery notes to allow file drop functionality and improved user feedback during file selection.
- Refactored purchasing page to integrate delivery notes that require review, providing better visibility and management of pending items.
- Added new KPIs to track active purchase orders and fulfillment percentages, improving overall dashboard insights.
2026-08-26 15:33:30 +02:00
DEls
84ff4c25b2 docs: add PO import queue spec/plan, ignore cooler.env, rewrite n8n ingest impl
Captures the async-queue redesign of the PO/DN import pipeline (see
spec + plan) and rewrites the n8n implementation doc to match the
new cron-driven architecture (workflow 005iI4jX5mq9DsTR). Also
gitignores cooler.env so the local-only deployment reference is no
longer tracked.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-19 22:03:39 +02:00
DEls
34f272f520 docs(n8n): mark old webhook-sync flow as superseded
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-19 20:03:11 +02:00
DEls
109a6938da Enhance PO upload error handling and validation
- Implement improved error handling for the purchase order upload process, ensuring that failures from n8n are properly surfaced to the user.
- Introduce a timeout mechanism for the n8n fetch request to handle potential delays more effectively.
- Refine the validation logic for the purchase order payload to ensure stricter adherence to expected formats and values.
2026-08-19 15:03:48 +02:00
DEls
14b63e50ab Design: Purchase Order upload + n8n ingestion
Adds design spec and n8n handoff doc for the new PO upload flow:
browser -> Next.js /api/purchase-orders/upload -> n8n OCR ->
Next.js /api/purchase-orders/ingest -> PocketBase via pbAdmin().

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-19 02:10:58 +02:00