import uuid from datetime import datetime from decimal import Decimal from pydantic import BaseModel, Field class HoursPayoutCreate(BaseModel): user_id: uuid.UUID hours: Decimal = Field(gt=0, le=999.99, decimal_places=2) period_year: int | None = Field(None, ge=2000, le=2100) period_month: int | None = Field(None, ge=1, le=12) note: str | None = Field(None, max_length=500) class HoursPayoutOut(BaseModel): model_config = {"from_attributes": True} id: uuid.UUID company_id: uuid.UUID user_id: uuid.UUID user_name: str # Computed: first_name + last_name (wird im Router gesetzt) hours: Decimal period_year: int | None period_month: int | None note: str | None created_by: uuid.UUID created_by_name: str # Computed im Router created_at: datetime class HoursPayoutListResponse(BaseModel): payouts: list[HoursPayoutOut] total_count: int