fix(api): Admin PATCH endpoint must sync ServiceExpertise and Arrays #383

Closed
opened 2026-07-01 02:33:24 +02:00 by kincses · 2 comments
Owner

Mérföldkő: P0 Provider Taxonomy & 3D Filtering
Cél: Fix the PATCH /admin/providers/{id} endpoint to properly sync ServiceExpertise and save the new multi-dimensional arrays

🔗 Függőségek (Dependencies)

  • Bemenet (Mikre támaszkodik): Card 1 (Provider model upgrades), existing admin_providers.py PATCH endpoint
  • Kimenet (Mik támaszkodnak rá): Card 3 (Frontend Matrix Edit UI)

📝 Feladat részletei

  1. Remove silent rollback: Replace the bare try/except around commit with proper error handling - raise HTTP 400 on IntegrityError instead of silently rolling back
  2. Expertise sync: After core fields update, call _sync_service_expertises() using the provided category_ids: List[int] from the request body
  3. Array persistence: Save the new supported_vehicle_classes and specializations arrays to both ServiceProvider and ServiceProfile models
  4. GET response verification: Ensure GET /admin/providers/{id} returns all three dimensions (vehicle classes, expertise tags, specializations) correctly
**Mérföldkő:** P0 Provider Taxonomy & 3D Filtering **Cél:** Fix the PATCH /admin/providers/{id} endpoint to properly sync ServiceExpertise and save the new multi-dimensional arrays ### 🔗 Függőségek (Dependencies) - **Bemenet (Mikre támaszkodik):** Card 1 (Provider model upgrades), existing admin_providers.py PATCH endpoint - **Kimenet (Mik támaszkodnak rá):** Card 3 (Frontend Matrix Edit UI) ### 📝 Feladat részletei 1. **Remove silent rollback:** Replace the bare try/except around commit with proper error handling - raise HTTP 400 on IntegrityError instead of silently rolling back 2. **Expertise sync:** After core fields update, call _sync_service_expertises() using the provided category_ids: List[int] from the request body 3. **Array persistence:** Save the new supported_vehicle_classes and specializations arrays to both ServiceProvider and ServiceProfile models 4. **GET response verification:** Ensure GET /admin/providers/{id} returns all three dimensions (vehicle classes, expertise tags, specializations) correctly
kincses added Status: In Progress and removed Status: To Do labels 2026-07-01 02:45:50 +02:00
kincses started working 2026-07-01 02:45:50 +02:00
Author
Owner

▶️ Munka megkezdve: 2026-07-01 02:45:50

▶️ **Munka megkezdve:** 2026-07-01 02:45:50
kincses added Status: Done and removed Status: In Progress labels 2026-07-01 02:51:31 +02:00
kincses worked for 5 minutes 2026-07-01 02:51:31 +02:00
Author
Owner

Munka befejezve: 2026-07-01 02:51:31

Technikai Összefoglaló:
fix(api): Admin PATCH endpoint now syncs ServiceExpertise and multi-dimensional arrays (supported_vehicle_classes, specializations) to both ServiceProvider and ServiceProfile models. GET endpoint resolves category_ids from ServiceExpertise join table. Changes applied to admin_providers.py: imports added, update_provider() extracts arrays from payload and calls _sync_service_expertises() with ServiceProfile ID, get_provider_detail() resolves category_ids via ServiceProfile → ServiceExpertise lookup.

⏱️ Az idő rögzítve.

✅ **Munka befejezve:** 2026-07-01 02:51:31 **Technikai Összefoglaló:** fix(api): Admin PATCH endpoint now syncs ServiceExpertise and multi-dimensional arrays (supported_vehicle_classes, specializations) to both ServiceProvider and ServiceProfile models. GET endpoint resolves category_ids from ServiceExpertise join table. Changes applied to admin_providers.py: imports added, update_provider() extracts arrays from payload and calls _sync_service_expertises() with ServiceProfile ID, get_provider_detail() resolves category_ids via ServiceProfile → ServiceExpertise lookup. ⏱️ *Az idő rögzítve.*
Sign in to join this conversation.