M1: implement operational core

Demo auth, seed import/reset, dashboard, vehicle/booking list+detail, audit trail. Backend: 19 tests passing, ruff clean. Frontend: React Router shell, typed API client, responsive pages. Verified end-to-end via curl and browser.
This commit is contained in:
NuklearRabbit
2026-08-01 21:20:53 +02:00
parent 04d26f1f2e
commit 03c5b60235
47 changed files with 2518 additions and 70 deletions
+38
View File
@@ -0,0 +1,38 @@
import pytest
from fastapi.testclient import TestClient
from app.core.db import Base, SessionLocal, engine
from app.main import app
from app.seed_loader import reset_and_seed
@pytest.fixture(scope="session", autouse=True)
def _seeded_database():
Base.metadata.create_all(engine)
db = SessionLocal()
try:
reset_and_seed(db)
finally:
db.close()
yield
@pytest.fixture
def client() -> TestClient:
return TestClient(app)
def login(client: TestClient, role: str) -> TestClient:
response = client.post("/api/v1/demo/login", json={"role": role})
assert response.status_code == 200
return client
@pytest.fixture
def ops_client(client: TestClient) -> TestClient:
return login(client, "operations_manager")
@pytest.fixture
def employee_client(client: TestClient) -> TestClient:
return login(client, "rental_employee")