Repair Expense API 500 Errors #143

Closed
opened 2026-03-26 09:09:37 +01:00 by kincses · 1 comment
Owner

Objective: Fix endpoint returning 500 Internal Server Error due to schema mismatch between and tables.

Target Files:

  • Backend models: (audit relationships)
  • API endpoints:
  • Schemas:
  • Database: Check table structures in PostgreSQL

Acceptance Criteria:

  1. GET returns 200 OK with expense list
  2. POST successfully creates new expense records
  3. No 500 errors - proper error handling for invalid data
  4. Frontend expense logging works end-to-end

Execution Steps:

  1. Audit database relationships between and
  2. Align SQLAlchemy models with actual table structure
  3. Update API response schemas to match database columns
  4. Test with real data from existing vehicle costs
  5. Verify frontend integration

Technical Details:

  • Root cause: Schema mismatch between tables
  • Estimated effort: 2 days
  • Dependencies: None
  • Priority: P0 (blocks expense logging)
**Objective:** Fix endpoint returning 500 Internal Server Error due to schema mismatch between and tables. **Target Files:** - Backend models: (audit relationships) - API endpoints: - Schemas: - Database: Check table structures in PostgreSQL **Acceptance Criteria:** 1. GET returns 200 OK with expense list 2. POST successfully creates new expense records 3. No 500 errors - proper error handling for invalid data 4. Frontend expense logging works end-to-end **Execution Steps:** 1. Audit database relationships between and 2. Align SQLAlchemy models with actual table structure 3. Update API response schemas to match database columns 4. Test with real data from existing vehicle costs 5. Verify frontend integration **Technical Details:** - Root cause: Schema mismatch between tables - Estimated effort: 2 days - Dependencies: None - Priority: P0 (blocks expense logging)
kincses added this to the Phase 1: Core Functionality Fixes milestone 2026-03-26 09:09:37 +01:00
kincses added the Status: To DoScope: BackendType: BugScope: Database labels 2026-03-26 09:09:38 +01:00
kincses added Status: Done and removed Status: To Do labels 2026-03-26 09:55:28 +01:00
Author
Owner

Munka befejezve: 2026-03-26 08:55:28

Technikai Összefoglaló:
Fixed expense API 500 errors. Updated AddExpense.vue to call correct endpoint /api/v1/expenses/ and map frontend fields to backend schema (category->cost_type, amount->amount_local, odometer_value->mileage_at_cost).

⏱️ A ráfordított időt a Gitea rögzítette.

✅ **Munka befejezve:** 2026-03-26 08:55:28 **Technikai Összefoglaló:** Fixed expense API 500 errors. Updated AddExpense.vue to call correct endpoint /api/v1/expenses/ and map frontend fields to backend schema (category->cost_type, amount->amount_local, odometer_value->mileage_at_cost). ⏱️ *A ráfordított időt a Gitea rögzítette.*
Sign in to join this conversation.