fix(payouts): 500 in GET /hr/payouts – computed Felder als optional

user_name/created_by_name sind Pflichtfelder, die der Router erst NACH
model_validate(payout) setzt – pydantic v2 schlägt aber schon bei der
Validierung fehl (Feld fehlt am ORM-Objekt). Default "" ergänzt; der
Router überschreibt die Werte wie bisher.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 22:35:40 +02:00
co-authored by Claude Opus 4.8
parent c497a14446
commit d27be740a0
+2 -2
View File
@@ -18,13 +18,13 @@ class HoursPayoutOut(BaseModel):
id: uuid.UUID id: uuid.UUID
company_id: uuid.UUID company_id: uuid.UUID
user_id: uuid.UUID user_id: uuid.UUID
user_name: str # Computed: first_name + last_name (wird im Router gesetzt) user_name: str = "" # Computed: first_name + last_name (wird im Router gesetzt)
hours: Decimal hours: Decimal
period_year: int | None period_year: int | None
period_month: int | None period_month: int | None
note: str | None note: str | None
created_by: uuid.UUID created_by: uuid.UUID
created_by_name: str # Computed im Router created_by_name: str = "" # Computed im Router
created_at: datetime created_at: datetime