From b314a781a16665b00af4c770321990b4d259f6db Mon Sep 17 00:00:00 2001 From: consultoria-as Date: Tue, 26 May 2026 04:37:05 +0000 Subject: [PATCH] feat: robust ML publish with pre-flight, preview, validation, async - Add /inventory-check endpoint for local pre-flight validation - Add /listings/validate endpoint using ML /items/validate API - Add /categories//attributes endpoint for required attrs - Add /listings/async + polling for background publishing via Celery - Editable preview: title (0/60 counter), price, stock per item - Pre-flight checks: image, stock, price, duplicate detection - Image upload directly from publish modal (uses existing /items//image) - Dynamic required attributes form based on selected ML category - Frontend: validate button, async polling with progress, detailed error display - Backend: build_item_payload supports custom_title, extra_attributes --- dashboard/landing.html | 130 +++++----- pos/blueprints/marketplace_external_bp.py | 130 ++++++++++ pos/services/marketplace_external_service.py | 177 ++++++++++++- pos/services/meli_service.py | 4 + pos/static/css/inventory.css | 67 +++++ pos/static/js/inventory.js | 260 ++++++++++++++++--- pos/tasks.py | 23 ++ pos/templates/inventory.html | 23 +- 8 files changed, 706 insertions(+), 108 deletions(-) diff --git a/dashboard/landing.html b/dashboard/landing.html index 27c16f3..049aa8e 100644 --- a/dashboard/landing.html +++ b/dashboard/landing.html @@ -4,7 +4,7 @@ Nexus Autoparts — Sistema completo para refaccionarias - + - +