- Add timezone configuration per space with fallback to system default - Implement timezone-aware datetime display and editing across frontend - Add migration for per_space_settings table - Update booking service to handle timezone conversions properly - Improve .gitignore to exclude build artifacts - Add comprehensive testing documentation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
49 lines
1.1 KiB
Python
49 lines
1.1 KiB
Python
"""Space schemas for request/response."""
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class SpaceBase(BaseModel):
|
|
"""Base space schema."""
|
|
|
|
name: str = Field(..., min_length=1)
|
|
type: str = Field(..., pattern="^(sala|birou)$")
|
|
capacity: int = Field(..., gt=0)
|
|
description: str | None = None
|
|
|
|
# Per-space scheduling settings (None = use global default)
|
|
working_hours_start: int | None = None
|
|
working_hours_end: int | None = None
|
|
min_duration_minutes: int | None = None
|
|
max_duration_minutes: int | None = None
|
|
|
|
|
|
class SpaceCreate(SpaceBase):
|
|
"""Space creation schema."""
|
|
|
|
pass
|
|
|
|
|
|
class SpaceUpdate(SpaceBase):
|
|
"""Space update schema."""
|
|
|
|
pass
|
|
|
|
|
|
class SpaceStatusUpdate(BaseModel):
|
|
"""Space status update schema."""
|
|
|
|
is_active: bool
|
|
|
|
|
|
class SpaceResponse(SpaceBase):
|
|
"""Space response schema."""
|
|
|
|
id: int
|
|
is_active: bool
|
|
working_hours_start: int | None = None
|
|
working_hours_end: int | None = None
|
|
min_duration_minutes: int | None = None
|
|
max_duration_minutes: int | None = None
|
|
|
|
model_config = {"from_attributes": True}
|