docs: document per-field approval API endpoints and UI
+4
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user