From c52f69a791c520afdfeb05660bc9fa05de867b2a Mon Sep 17 00:00:00 2001 From: Shawn Date: Sat, 23 May 2026 18:35:48 -0400 Subject: [PATCH] docs: document per-field approval API endpoints and UI --- Home.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Home.md b/Home.md index e6013b9..7c6ef0d 100644 --- a/Home.md +++ b/Home.md @@ -42,6 +42,9 @@ Staged import pipeline for Cantaloupe machine data: | GET | `/api/admin/cantaloupe/batches/{id}` | Full batch detail with row-level diff | | POST | `/api/admin/cantaloupe/batches/{id}/approve` | Apply staged data (upsert assets/customers/locations) | | POST | `/api/admin/cantaloupe/batches/{id}/reject` | Discard batch, clear raw_data | +| GET | `/api/admin/cantaloupe/batches/{id}/field-changes` | Flat list of per-field diffs with `is_blank_fill` flag | +| POST | `/api/admin/cantaloupe/batches/{id}/apply-field-changes` | Apply selected field changes only (granular per-field approval) | +| POST | `/api/admin/cantaloupe/batches/{id}/replacements` | Approve/reject individual machine replacement candidates | **Database table:** `cantaloupe_sync_batches` — id, status (pending/approved/rejected/error), created_at, approved_at, file_path, row_count, diff_summary (JSON), raw_data (JSON), error_message. @@ -77,6 +80,7 @@ A new "Cantaloupe Sync" page in the admin SPA at `static/index.html` provides a - **Sync Overview** — Latest batch status badge (pending/approved/rejected/error), diff summary counts (New/Changed/Removed), last sync time, and "Sync Now" button - **Pending Batch Review** — Approve/reject buttons with full diff tables showing Machine ID, Name, Field, Old Value → New Value +- **Per-Field Approval (c35e2a1+) —** "📋 Review Changes" button opens geotagger-style cards with checkboxes per field. Blank-fill changes auto-selected. Sticky apply bar at bottom. Apply only selected changes without approving the whole batch. - **Import History** — Expandable rows with status badges, timestamps, and lazy-loaded diff detail - Dark theme matching existing admin UI, vanilla JS with fetch(), loading/error states