CI / backend-tests (push) Failing after 0s
- ORM-Modelle: Bereich, Kategorie, Standort, Objekttyp, Material (Prompt 06/07),
minimales Objekt-Modell (voll ausgebaut erst Sprint 2), Zustaendigkeit/
Kontrollverantwortung
- Admin-API 7a: GET/POST Stammdaten-Endpunkte, PATCH Material, Benutzerverwaltung
(anlegen/Rollen ändern), Zuständigkeits-/Kontrollverantwortungs-CRUD
- Vererbungslogik E2 als eigener Service (app/services/zustaendigkeit.py):
Standort-Zuordnung vererbt sich auf alle Objekte, Objekt-Zeile ist Vereinigung
statt Ersatz - GET /zustaendigkeiten/benutzer/{id}/objekte exponiert das
- Tests: Stammdaten-CRUD + Rollenrechte, Benutzerverwaltung (inkl. 409 bei
Login-Duplikat), E2-Vererbungslogik (Standort-only, Standort+Objekt-Vereinigung,
End-to-End über den Endpunkt)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L85hmKbvX7Cqkq47KnQhFt
77 lines
1.7 KiB
Python
77 lines
1.7 KiB
Python
from pydantic import BaseModel, ConfigDict
|
|
|
|
from app.models.stammdaten import MaterialTyp
|
|
|
|
|
|
class BereichCreate(BaseModel):
|
|
name: str
|
|
beschreibung: str | None = None
|
|
|
|
|
|
class BereichRead(BereichCreate):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
|
|
|
|
class KategorieCreate(BaseModel):
|
|
bereich_id: int
|
|
name: str
|
|
ueberkategorie_id: int | None = None
|
|
|
|
|
|
class KategorieRead(KategorieCreate):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
|
|
|
|
class StandortCreate(BaseModel):
|
|
name: str
|
|
adresse: str | None = None
|
|
|
|
|
|
class StandortRead(StandortCreate):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
|
|
|
|
class ObjekttypCreate(BaseModel):
|
|
bereich_id: int
|
|
kategorie_id: int | None = None
|
|
name: str
|
|
|
|
|
|
class ObjekttypRead(ObjekttypCreate):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
|
|
|
|
class MaterialCreate(BaseModel):
|
|
name: str
|
|
artikelnummer: str | None = None
|
|
einheit: str
|
|
materialtyp: MaterialTyp
|
|
kategorie_id: int | None = None
|
|
hersteller: str | None = None
|
|
beschreibung: str | None = None
|
|
code: str | None = None
|
|
warnzeitraum_tage: int | None = None
|
|
aktiv: bool = True
|
|
|
|
|
|
class MaterialUpdate(BaseModel):
|
|
name: str | None = None
|
|
artikelnummer: str | None = None
|
|
einheit: str | None = None
|
|
materialtyp: MaterialTyp | None = None
|
|
kategorie_id: int | None = None
|
|
hersteller: str | None = None
|
|
beschreibung: str | None = None
|
|
code: str | None = None
|
|
warnzeitraum_tage: int | None = None
|
|
aktiv: bool | None = None
|
|
|
|
|
|
class MaterialRead(MaterialCreate):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|