From fe59b0df9352b5d9a6b9bf1ea4d42b089d172209 Mon Sep 17 00:00:00 2001 From: Shawn Date: Thu, 21 May 2026 19:20:03 -0400 Subject: [PATCH] Add Cantaloupe Sync API documentation --- Home.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Home.md b/Home.md index 3a37170..244e839 100644 --- a/Home.md +++ b/Home.md @@ -21,7 +21,25 @@ NPMPlus proxy updated: forward_port 8901 → 8090, forward_scheme https → http ## Endpoints -See the [[Home]] page for full endpoint documentation. +All standard admin CRUD endpoints for users, customers, locations, rooms, geofences, settings, activity log, stats, CSV exports, and database management. + +### Cantaloupe Sync API (since f7ffa0e) + +Staged import pipeline for Cantaloupe machine data: + +| Method | Path | Description | +|--------|------|-------------| +| POST | `/api/admin/cantaloupe/sync` | Upload Excel, parse, diff, store as pending batch | +| GET | `/api/admin/cantaloupe/batches` | List all sync batches (filterable by status) | +| 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 | + +**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. + +**Column mapping:** Heuristic word-subset matching of Excel headers to canteen schema fields (machine_id, serial_number, name, customer, location, address, etc.) + +**Tests:** 10 unit tests (test_cantaloupe_sync.py) + 23 integration tests (test_sync_api.py). All 33 pass. ## Related