P0 BUGFIX: SimpleFuelModal 500 POST crash + 5 frontend issues #405

Closed
opened 2026-07-10 16:14:16 +02:00 by kincses · 2 comments
Owner

Mérföldkő: P0 Hybrid Vendor Refactor
Cél: Javítsa ki a SimpleFuelModal súlyos hibáit: backend 500 POST crash, frontend elavult provider adatok, hiányzó pénznemválasztó, törött Magic Triangle matek és hiányzó kilométeróra tipp.

🔗 Függőségek (Dependencies)

  • Bemenet (Mikre támaszkodik): PostgreSQL (fleet.organizations, marketplace.service_providers), FastAPI backend, Vue 3 frontend
  • Kimenet (Mik támaszkodnak rá): Dashboard fuel logging, TCO/költség számítás

📝 Elemzés

A POST /expenses/ 500-as hibát az FK constraint megsértése okozta: a frontend ServiceProvider.id-t (6) küldött vendor_organization_id-ként, de az FK a fleet.organizations táblára hivatkozik. A ProviderAutocomplete három forrásból ad vissza találatokat (verified_org, staged_data, crowd_added), és a crowd_added forrásból származó ID-k nem léteznek a fleet.organizations táblában. Emellett 5 frontend hiba is javításra került.

**Mérföldkő:** P0 Hybrid Vendor Refactor **Cél:** Javítsa ki a SimpleFuelModal súlyos hibáit: backend 500 POST crash, frontend elavult provider adatok, hiányzó pénznemválasztó, törött Magic Triangle matek és hiányzó kilométeróra tipp. ### 🔗 Függőségek (Dependencies) - **Bemenet (Mikre támaszkodik):** PostgreSQL (fleet.organizations, marketplace.service_providers), FastAPI backend, Vue 3 frontend - **Kimenet (Mik támaszkodnak rá):** Dashboard fuel logging, TCO/költség számítás ### 📝 Elemzés A POST /expenses/ 500-as hibát az FK constraint megsértése okozta: a frontend ServiceProvider.id-t (6) küldött vendor_organization_id-ként, de az FK a fleet.organizations táblára hivatkozik. A ProviderAutocomplete három forrásból ad vissza találatokat (verified_org, staged_data, crowd_added), és a crowd_added forrásból származó ID-k nem léteznek a fleet.organizations táblában. Emellett 5 frontend hiba is javításra került.
kincses added the Scope: FrontendType: BugStatus: In Progress labels 2026-07-10 16:14:25 +02:00
kincses started working 2026-07-10 16:14:25 +02:00
Author
Owner

▶️ Munka megkezdve: 2026-07-10 16:14:25

▶️ **Munka megkezdve:** 2026-07-10 16:14:25
kincses added Status: Done and removed Status: In Progress labels 2026-07-10 16:15:20 +02:00
kincses worked for 55 seconds 2026-07-10 16:15:20 +02:00
Author
Owner

Munka befejezve: 2026-07-10 16:15:20

Technikai Összefoglaló:
P0 BUGFIX: SimpleFuelModal 500 POST crash + 5 frontend issues. Root cause: vendor_organization_id received ServiceProvider.id (6) instead of Organization.id, violating FK constraint fk_asset_costs_vendor_org. Fixes: (1) Backend FK-safe validation in expenses.py - checks if vendor_organization_id exists in fleet.organizations, falls back to service_provider_id if not. Added missing SystemParameter import. (2) Frontend source-aware provider routing - sends vendor_organization_id only for verified_org source, service_provider_id for crowd_added. (3) Currency selector (HUF/EUR) added to form. (4) Magic Triangle changed from @input to @blur events to prevent infinite recursion. (5) Odometer hint response parsing fixed for {status, total, data} wrapper format. (6) providers/search 500 error fixed with try-except around AddressOut construction. All verified: sync_engine 1287/1287 OK, Python syntax OK.

⏱️ Az idő rögzítve.

✅ **Munka befejezve:** 2026-07-10 16:15:20 **Technikai Összefoglaló:** P0 BUGFIX: SimpleFuelModal 500 POST crash + 5 frontend issues. Root cause: vendor_organization_id received ServiceProvider.id (6) instead of Organization.id, violating FK constraint fk_asset_costs_vendor_org. Fixes: (1) Backend FK-safe validation in expenses.py - checks if vendor_organization_id exists in fleet.organizations, falls back to service_provider_id if not. Added missing SystemParameter import. (2) Frontend source-aware provider routing - sends vendor_organization_id only for verified_org source, service_provider_id for crowd_added. (3) Currency selector (HUF/EUR) added to form. (4) Magic Triangle changed from @input to @blur events to prevent infinite recursion. (5) Odometer hint response parsing fixed for {status, total, data} wrapper format. (6) providers/search 500 error fixed with try-except around AddressOut construction. All verified: sync_engine 1287/1287 OK, Python syntax OK. ⏱️ *Az idő rögzítve.*
Sign in to join this conversation.