fix: repair Rentman equipment sync with real API field mapping
- Map real Rentman fields: price -> rental_price, folder -> category/subcategory (resolved via folder hierarchy to top-level categories), code -> number, shop_description_long (fallback short/external_remark) -> description (HTML stripped) - Sync only in_shop items; exclude archived/temporary from public catalog - Extract known brands from equipment names (d&b, Shure, Pioneer, ...) - Build specifications from physical fields (power, weight, dimensions) - Persist equipment images in docker volume (survive redeploys) - Router: filter available items, add price_asc/price_desc sorting - Frontend: show prices in catalog card, detail page and cart with per-day subtotal; price sorting options - Tests: use real Rentman field names in fixtures, mock folder_map
This commit is contained in:
@@ -53,8 +53,9 @@ class SyncService:
|
||||
# Ensure images directory exists
|
||||
os.makedirs(IMAGES_DIR, exist_ok=True)
|
||||
|
||||
# Fetch all equipment from Rentman
|
||||
# Fetch all equipment and folders from Rentman
|
||||
all_equipment = await self.rentman.get_all_equipment(limit=100)
|
||||
folder_map = await self.rentman.get_folder_map()
|
||||
|
||||
# Build set of rentman_ids from API for availability check
|
||||
api_rentman_ids = set()
|
||||
@@ -75,7 +76,7 @@ class SyncService:
|
||||
continue
|
||||
|
||||
try:
|
||||
transformed = await self.rentman.transform_equipment(raw_item)
|
||||
transformed = await self.rentman.transform_equipment(raw_item, folder_map=folder_map)
|
||||
await self._upsert_equipment(transformed)
|
||||
|
||||
# Download image if S3 URL available
|
||||
|
||||
Reference in New Issue
Block a user