Files
timemaster/backend/app/schemas/project.py
T
sysops 1fedd683e0 Initial commit – TimeMaster Zeiterfassung & HR-Tool
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>
2026-05-23 20:03:27 +02:00

49 lines
1.2 KiB
Python

import uuid
from datetime import datetime
from pydantic import BaseModel, Field
class ProjectOut(BaseModel):
model_config = {"from_attributes": True}
id: uuid.UUID
company_id: uuid.UUID
name: str
description: str | None
color: str
budget_hours: float | None
is_active: bool
created_at: datetime
updated_at: datetime
class ProjectCreate(BaseModel):
name: str = Field(min_length=1, max_length=100)
description: str | None = None
color: str = Field("#3B82F6", pattern=r"^#[0-9A-Fa-f]{6}$")
budget_hours: float | None = Field(None, ge=0.1, le=99999)
class ProjectUpdate(BaseModel):
name: str | None = Field(None, min_length=1, max_length=100)
description: str | None = None
color: str | None = Field(None, pattern=r"^#[0-9A-Fa-f]{6}$")
budget_hours: float | None = Field(None, ge=0.1, le=99999)
is_active: bool | None = None
class ProjectListResponse(BaseModel):
total: int
items: list[ProjectOut]
class ProjectTimeReport(BaseModel):
project_id: uuid.UUID
project_name: str
project_color: str
total_hours: float
entry_count: int
budget_hours: float | None
budget_used_pct: float | None # None wenn kein Budget