MEGAINFRA-WEBAPP/src/app
DEls d5b691e2ad feat(api): hash-based dedup in /purchase-orders/upload
SHA-256 the file bytes, look for a recent (30-day) processed
data_import_batches row with the same hash, and short-circuit with
200 { duplicate: true, existing_batch_id, existing_po_id } when found.

Saves an AI extraction call + a cron tick for byte-identical re-uploads.
Stores file_hash on the new batch row so future re-uploads can match
against it.

Backed by a new index (idx_batches_file_hash on file_hash, status)
and a new file_hash column (text, 64 chars) on data_import_batches
applied via PB admin API.

Tests: 11 in this file (covering happy path, byte-identical re-uploads,
hash collisions, dedup-query failures, and existing edge cases).
2026-08-20 00:51:15 +02:00
..
api feat(api): hash-based dedup in /purchase-orders/upload 2026-08-20 00:51:15 +02:00
dashboard Mount UploadPurchaseOrderButton on /dashboard/purchasing 2026-08-19 15:03:47 +02:00
login Initial commit: MEGA INFRASTRUCTURE dashboard + Coolify Dockerfile 2026-08-09 01:37:40 +02:00
globals.css Initial commit: MEGA INFRASTRUCTURE dashboard + Coolify Dockerfile 2026-08-09 01:37:40 +02:00
layout.tsx Fix Umami script URL: use HTTPS to avoid mixed-content blocking 2026-08-10 11:35:59 +02:00
page.tsx Initial commit: MEGA INFRASTRUCTURE dashboard + Coolify Dockerfile 2026-08-09 01:37:40 +02:00