1fedd683e0
Stand: agent-06 (Audit-Log), agent-05 (Krankmeldung), agent-07 Phase 1 (Personalnummer), Busylight-Pull-Integration, TOTP/2FA, Abwesenheiten, Zeiterfassung, Kiosk-Grundgerüst. Migrations 0001–0023 deployed auf 192.168.1.137 + .164. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
import uuid
|
||
from datetime import datetime
|
||
|
||
from pydantic import BaseModel, Field, field_validator
|
||
|
||
|
||
class KioskDeviceCreate(BaseModel):
|
||
name: str = Field(..., min_length=1, max_length=255)
|
||
location: str | None = Field(None, max_length=255)
|
||
|
||
@field_validator("name")
|
||
@classmethod
|
||
def name_not_blank(cls, v: str) -> str:
|
||
if not v.strip():
|
||
raise ValueError("Name darf nicht nur aus Leerzeichen bestehen.")
|
||
return v.strip()
|
||
|
||
|
||
class KioskDeviceUpdate(BaseModel):
|
||
name: str | None = Field(None, min_length=1, max_length=255)
|
||
location: str | None = Field(None, max_length=255)
|
||
|
||
@field_validator("name")
|
||
@classmethod
|
||
def name_not_blank(cls, v: str | None) -> str | None:
|
||
if v is not None:
|
||
if not v.strip():
|
||
raise ValueError("Name darf nicht nur aus Leerzeichen bestehen.")
|
||
return v.strip()
|
||
return v
|
||
is_active: bool | None = None
|
||
|
||
|
||
class KioskDeviceOut(BaseModel):
|
||
model_config = {"from_attributes": True}
|
||
|
||
id: uuid.UUID
|
||
company_id: uuid.UUID
|
||
name: str
|
||
location: str | None
|
||
is_active: bool
|
||
last_seen_at: datetime | None
|
||
created_at: datetime
|
||
|
||
|
||
class KioskDeviceCreated(KioskDeviceOut):
|
||
"""Wird nur einmalig bei Erstellung zurückgegeben – enthält den Klartext-Token."""
|
||
token: str
|