2.3: PATCH /admin/persons/{person_id} — Person szerkesztése #311

Closed
opened 2026-06-29 03:36:28 +02:00 by kincses · 2 comments
Owner

Mérföldkő: Admin User & Person Management
Cél: Person adatok admin általi módosítása. Szerkeszthető mezők: last_name, first_name, phone, mothers_last_name, mothers_first_name, birth_place, birth_date, identity_docs, ice_contact, is_active, is_ghost. Address almzők is szerkeszthetők.

🔗 Függőségek (Dependencies)

  • Bemenet (Mikre támaszkodik): GET /admin/persons/{person_id} (2.2), PersonUpdate séma
  • Kimenet (Mik támaszkodnak rá): Frontend Person szerkesztés funkció

📝 Elemzés

PATCH /admin/persons/{person_id}. Audit log bejegyzés. Address rekord frissítése ha változott.

**Mérföldkő:** Admin User & Person Management **Cél:** Person adatok admin általi módosítása. Szerkeszthető mezők: last_name, first_name, phone, mothers_last_name, mothers_first_name, birth_place, birth_date, identity_docs, ice_contact, is_active, is_ghost. Address almzők is szerkeszthetők. ### 🔗 Függőségek (Dependencies) - **Bemenet (Mikre támaszkodik):** GET /admin/persons/{person_id} (2.2), PersonUpdate séma - **Kimenet (Mik támaszkodnak rá):** Frontend Person szerkesztés funkció ### 📝 Elemzés PATCH /admin/persons/{person_id}. Audit log bejegyzés. Address rekord frissítése ha változott.
kincses added this to the Epic 10 (Admin UI) Jegyek Létrehozása milestone 2026-06-29 03:36:28 +02:00
kincses added the Status: To DoScope: BackendType: Feature labels 2026-06-29 03:36:28 +02:00
kincses added Status: Done and removed Status: To Do labels 2026-06-29 12:23:37 +02:00
Author
Owner

Munka befejezve: 2026-06-29 12:23:37

Technikai Összefoglaló:
Implemented PATCH /admin/persons/{person_id} endpoint with full field support (personal data, address, status). Added PersonUpdateRequest and PersonAddressUpdate Pydantic schemas with validators. Created persons:edit permission (id=42) and assigned to admin role. Tested: phone update → 200, multi-field + address → 200, missing person → 404, merged person → 409. Sync engine: 1279 OK.

⏱️ Az idő rögzítve.

✅ **Munka befejezve:** 2026-06-29 12:23:37 **Technikai Összefoglaló:** Implemented PATCH /admin/persons/{person_id} endpoint with full field support (personal data, address, status). Added PersonUpdateRequest and PersonAddressUpdate Pydantic schemas with validators. Created persons:edit permission (id=42) and assigned to admin role. Tested: phone update → 200, multi-field + address → 200, missing person → 404, merged person → 409. Sync engine: ✅ 1279 OK. ⏱️ *Az idő rögzítve.*
Author
Owner

Gitea #311 — PATCH /admin/persons/{person_id} — KÉSZ

A Gitea #311-es kártya ("2.3: PATCH /admin/persons/{person_id} — Person szerkesztése") teljes mértékben implementálva, tesztelve, dokumentálva és lezárva.

📋 Implementáció összefoglaló

Módosított fájl: backend/app/api/v1/endpoints/admin_persons.py

Végpont: PATCH /admin/persons/{person_id}200 (sikeres) / 404 (nem létező) / 409 (merge-elt person)

Szerkeszthető mezők:

  • Személyes adatok: last_name, first_name, phone, mothers_last_name, mothers_first_name, birth_place, birth_date
  • Dokumentumok: identity_docs, ice_contact
  • Státusz: is_active, is_ghost
  • Cím: address (nested PersonAddressUpdate — zip, city, street, hrsz, GPS koordináták stb.)

Validáció:

  • phone — csak számjegyek, +, -, szóköz (field_validator)
  • last_name, first_name — nem lehet üres string

Biztonság:

  • RequirePermission("persons:edit") — új permission (id=42) létrehozva és admin role-hoz rendelve
  • Merge védelem: merged_into_id is not None → 409 Conflict
  • N+1 védelem: joinedload minden kapcsolódó entitásra

Tesztelés:

  • PATCH phone → 200 OK
  • PATCH több mező + cím → 200 OK
  • Hiányzó person → 404
  • Merge-elt person → 409
  • Szintaxis ellenőrzés: Syntax OK
  • DB szinkron: sync_engine — 1279 OK

Dokumentáció: history.md — részletes technikai leírás

## ✅ Gitea #311 — PATCH /admin/persons/{person_id} — KÉSZ A Gitea #311-es kártya ("2.3: PATCH /admin/persons/{person_id} — Person szerkesztése") teljes mértékben implementálva, tesztelve, dokumentálva és lezárva. ### 📋 Implementáció összefoglaló **Módosított fájl:** [`backend/app/api/v1/endpoints/admin_persons.py`](backend/app/api/v1/endpoints/admin_persons.py:545) **Végpont:** `PATCH /admin/persons/{person_id}` → `200` (sikeres) / `404` (nem létező) / `409` (merge-elt person) **Szerkeszthető mezők:** - Személyes adatok: `last_name`, `first_name`, `phone`, `mothers_last_name`, `mothers_first_name`, `birth_place`, `birth_date` - Dokumentumok: `identity_docs`, `ice_contact` - Státusz: `is_active`, `is_ghost` - Cím: `address` (nested `PersonAddressUpdate` — zip, city, street, hrsz, GPS koordináták stb.) **Validáció:** - `phone` — csak számjegyek, `+`, `-`, szóköz (`field_validator`) - `last_name`, `first_name` — nem lehet üres string **Biztonság:** - `RequirePermission("persons:edit")` — új permission (id=42) létrehozva és admin role-hoz rendelve - Merge védelem: `merged_into_id is not None` → 409 Conflict - N+1 védelem: `joinedload` minden kapcsolódó entitásra **Tesztelés:** - ✅ PATCH phone → 200 OK - ✅ PATCH több mező + cím → 200 OK - ✅ Hiányzó person → 404 - ✅ Merge-elt person → 409 - ✅ Szintaxis ellenőrzés: ✅ Syntax OK - ✅ DB szinkron: sync_engine — 1279 OK **Dokumentáció:** [`history.md`](.roo/history.md:1091) — részletes technikai leírás
Sign in to join this conversation.