Implement complete multi-property architecture: - Properties (groups of spaces) with public/private visibility - Property managers (many-to-many) with role-based permissions - Organizations with member management - Anonymous/guest booking support via public API (/api/public/*) - Property-scoped spaces, bookings, and settings - Frontend: property selector, organization management, public booking views - Migration script and updated seed data Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
42 lines
840 B
Python
42 lines
840 B
Python
"""Organization schemas."""
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class OrganizationCreate(BaseModel):
|
|
name: str = Field(..., min_length=1)
|
|
description: str | None = None
|
|
|
|
|
|
class OrganizationUpdate(BaseModel):
|
|
name: str | None = None
|
|
description: str | None = None
|
|
|
|
|
|
class OrganizationResponse(BaseModel):
|
|
id: int
|
|
name: str
|
|
description: str | None = None
|
|
is_active: bool
|
|
created_at: datetime
|
|
member_count: int = 0
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class OrganizationMemberResponse(BaseModel):
|
|
id: int
|
|
organization_id: int
|
|
user_id: int
|
|
role: str
|
|
user_name: str | None = None
|
|
user_email: str | None = None
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class AddMemberRequest(BaseModel):
|
|
user_id: int
|
|
role: str = "member"
|