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:
Agent Zero
2026-09-24 21:26:18 +02:00
parent 654ec09ce1
commit df50ea8b4b
10 changed files with 233 additions and 39 deletions
+3 -2
View File
@@ -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