admin felület bekötése. pontosítások2
This commit is contained in:
114
.roo/history.md
114
.roo/history.md
@@ -709,3 +709,117 @@ A frontend által hívott `GET /api/v1/admin/organizations/43/vehicles` végpont
|
||||
### ✅ Verifikáció
|
||||
- `GET /api/v1/admin/organizations/43/vehicles` → **200 OK**
|
||||
- Visszaadott 3 jármű helyes adatokkal (brand, model, year, license_plate, branch_name)
|
||||
|
||||
## 2026-06-26 - P0 HOTFIX: Corporate 500 Error & Shrinking Filter Paradox
|
||||
|
||||
### 🎯 Cél
|
||||
Két kritikus bug javítása: (1) `org_type_filter=corporate` 500-as hibát dobott a backendben, mert a "corporate" nem létező érték a `fleet.orgtype` PostgreSQL enum-ban. (2) A frontend előfizetési csomag legördülő menüje összezsugorodott szűréskor, mert a `uniqueTiers` computed property a szűrt `garages` tömbből számolt.
|
||||
|
||||
### 🔧 Változtatások
|
||||
|
||||
**Backend** (`backend/app/api/v1/endpoints/admin_organizations.py:219`):
|
||||
- `org_type_filter=corporate` esetén a backend most az összes nem-individual `OrgType` értékre szűr (`business`, `fleet_owner`, `service`, `service_provider`, `club`)
|
||||
- A `OrgType` enum dinamikus lekérdezése biztosítja, hogy új típus hozzáadásakor is működjön
|
||||
|
||||
**Frontend** (`frontend_admin/pages/garages/index.vue`):
|
||||
- `uniqueTiers` computed property eltávolítva
|
||||
- Helyette `availableTierNames` ref + watcher, ami csak bővül, sosem zsugorodik
|
||||
- `watch(garages, ...)` `immediate: true, deep: true` paraméterekkel
|
||||
|
||||
### ✅ Verifikáció
|
||||
- `GET /api/v1/admin/organizations?org_type_filter=corporate` → **200 OK**, 8 garázs (business, fleet_owner, service_provider)
|
||||
- `GET /api/v1/admin/organizations?org_type_filter=individual` → **200 OK**, 17 garázs (individual)
|
||||
- Admin frontend újraindítva, build hiba nélkül
|
||||
|
||||
## 2026-06-26 - P0 UX/UI Polish: Subscription Tab, History & Header ID Fix
|
||||
|
||||
### 🎯 Cél
|
||||
Admin garázs részletek oldal UX/UI javítása: Header ID bug fix, kattintható garázsnevek listában, Subscription card sűrítése utilization statokkal, Subscription History szekció hozzáadása.
|
||||
|
||||
### 🔧 Módosított fájlok
|
||||
|
||||
**Frontend** (`frontend_admin/pages/garages/[id]/index.vue`):
|
||||
- **Header ID Fix**: Eltávolítva a duplikált `#{{ garage.id }}` a subtitle-ből. `garageDisplayName()` fallback javítva: `'Garage #' + garage.value.id` formátumra.
|
||||
- **Subscription Card Densification**: 4-oszlopos grid layout utilization statokkal (Járművek, Telephelyek, Dolgozók) progress bar-okkal, színkódolt threshold-okkal (piros ≥90%, borostyán ≥70%).
|
||||
- **Subscription History Section**: Új kártya adat táblával és üres állapottal (clock SVG ikon + "Még nincsenek előfizetési előzmények" üzenet).
|
||||
- **Új computed properties**: `employeeQuotaLimit`, `branchQuotaPercent`, `employeeQuotaPercent`.
|
||||
|
||||
**Frontend** (`frontend_admin/pages/garages/index.vue`):
|
||||
- **Kattintható garázsnevek**: A garázs név `<NuxtLink>`-be csomagolva, hover stylinggal (`hover:underline cursor-pointer hover:text-indigo-400`).
|
||||
|
||||
**Frontend i18n** (`frontend_admin/i18n/locales/en.json`, `frontend_admin/i18n/locales/hu.json`):
|
||||
- 10 új i18n kulcs hozzáadva: `vehicles_used`, `branches_used`, `employees_used`, `status`, `subscription_history`, `history_date`, `history_package`, `history_action`, `history_status`, `no_subscription_history`.
|
||||
|
||||
### ✅ Verifikáció
|
||||
- `docker compose exec sf_public_frontend npm run build` → **✓ built in 7.13s**, hiba nélkül
|
||||
|
||||
## 2026-06-26 - Admin Garage System Identifiers Bugfix
|
||||
|
||||
### 🎯 Cél
|
||||
Admin garázs részletek oldalon a "Rendszer Azonosítók" szekcióban a User ID és Person ID mezők "N/A"-t mutattak, mert a backend `GarageDetailsResponse` nem tartalmazott `owner_user_id` mezőt, a frontend pedig egy nem létező `garage.owner?.id` property-t próbált olvasni.
|
||||
|
||||
### 🔧 Változtatások
|
||||
|
||||
**Backend** (`backend/app/api/v1/endpoints/admin_organizations.py`):
|
||||
- `GarageDetailsResponse` osztályhoz hozzáadva: `owner_user_id: Optional[int] = None` (169. sor)
|
||||
- Visszatérési értékhez hozzáadva: `owner_user_id=owner.id if owner else None` (650. sor)
|
||||
|
||||
**Frontend** (`frontend_admin/pages/garages/[id]/index.vue`):
|
||||
- 200. sor: `garage.owner?.id || 'N/A'` → `garage.owner_user_id ?? 'N/A'`
|
||||
|
||||
### ✅ Verifikáció
|
||||
- `GET /api/v1/admin/organizations/43/details` → `owner_user_id: 79`, `owner_person_id: 86` (korábban hiányzott)
|
||||
|
||||
## 2026-06-26 — Bug Analysis: Admin Garage Subscription Tab Shows Wrong Package Data
|
||||
|
||||
**Gitea Issue:** #301
|
||||
**Scope:** Backend + Frontend
|
||||
**Type:** Bug
|
||||
|
||||
### What was found
|
||||
Investigated why the admin frontend's garage detail page subscription tab doesn't display data matching the selected package.
|
||||
|
||||
**Root Causes:**
|
||||
1. `SubscriptionSummary` Pydantic model (admin_organizations.py:116-124) missing `branch_limit` field — frontend (index.vue:526) accesses `garage.subscription?.branch_limit` which is always undefined, showing `∞`
|
||||
2. `asset_limit` extraction fragile (admin_organizations.py:462-465): `or` logic treats `0` as falsy, falls back to `1` on missing/alternate keys
|
||||
3. `GarageDetailsResponse` has no `branches` field — `garage.branches?.length` always 0
|
||||
4. `asset_count` hardcoded to 0 (admin_organizations.py:473)
|
||||
5. `OrganizationSubscription` query (admin_organizations.py:414-425) doesn't check `valid_until >= now()` — expired subs appear active
|
||||
6. Fallback path (admin_organizations.py:476-488) incomplete — missing `valid_from` and `is_active`
|
||||
|
||||
### Fix created
|
||||
Detailed fix spec written to `docs/admin_garage_subscription_tab_bugfix_spec.md`
|
||||
|
||||
## 2026-06-26 — P0 CORE LOGIC & ADD-ON UPGRADE — Execute Bugfix #301 & Extra Allowances
|
||||
|
||||
**Gitea Issue:** #301 (Bugfix) + P0 Add-on Upgrade
|
||||
**Scope:** Backend + Frontend
|
||||
**Type:** Bug + Feature
|
||||
|
||||
### 🔧 Módosított fájlok
|
||||
- [`backend/app/api/v1/endpoints/admin_organizations.py`](backend/app/api/v1/endpoints/admin_organizations.py:47) — Backend API changes
|
||||
- `OrgSubscriptionUpdate`: Added `extra_vehicles`, `extra_branches`, `extra_users` fields (lines 56-67)
|
||||
- `SubscriptionSummary`: Added `branch_limit`, `user_limit`, `extra_allowances` fields (lines 138-142)
|
||||
- `BranchBrief`: New Pydantic model for branch data (lines 145-150)
|
||||
- `GarageDetailsResponse`: Added `branches: List[BranchBrief]` field (line 202)
|
||||
- `get_organization_details` (line 404):
|
||||
- Added `valid_until >= now` check to subscription query (line 449)
|
||||
- Added real `asset_count` query from Vehicle table (lines 458-464)
|
||||
- Added branches query from Branch table (lines 467-482)
|
||||
- **Bugfix**: Replaced `or` operator with explicit `dict.get()` for limit calculations (lines 524-537)
|
||||
- **Add-on math**: Base (from tier rules) + Extra (from extra_allowances JSONB) = Total limit
|
||||
- `update_org_subscription` (line 983):
|
||||
- Constructs `extra_allowances` JSONB from payload fields (lines 1044-1051)
|
||||
- Passes to new `OrganizationSubscription` (line 1060)
|
||||
- Returns `extra_allowances` in response (line 1090)
|
||||
- [`frontend_admin/pages/garages/[id]/index.vue`](frontend_admin/pages/garages/[id]/index.vue:1463) — Frontend UI changes
|
||||
- Added `extraVehicles`, `extraBranches`, `extraUsers` reactive state (lines 1463-1466)
|
||||
- Added `employeeQuotaPercent` computed property (lines 1510-1515)
|
||||
- Updated Employees tab: utilization bar with `user_limit` (line 544-547)
|
||||
- Added add-on input cards: Extra Jármű, Extra Telephely, Extra Dolgozó (template section ~lines 611-685)
|
||||
- Updated `updateSubscription`: sends extra_allowances payload (lines 1858-1861)
|
||||
|
||||
### ✅ Verifikáció
|
||||
- `sync_engine.py`: 1278 elements OK — system perfectly in sync
|
||||
- `test_subscription_feature_flags.py`: All 6 steps passed (login, feature flags, check, public tiers)
|
||||
- Python syntax check: ✅ Syntax OK
|
||||
|
||||
Reference in New Issue
Block a user