33 lines
710 B
Python
33 lines
710 B
Python
from pydantic import BaseModel, ConfigDict
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
from uuid import UUID
|
|
|
|
|
|
class MapBase(BaseModel):
|
|
"""Base map schema with common attributes."""
|
|
name: str
|
|
description: Optional[str] = None
|
|
|
|
|
|
class MapCreate(MapBase):
|
|
"""Schema for creating a new map."""
|
|
pass
|
|
|
|
|
|
class MapUpdate(BaseModel):
|
|
"""Schema for updating map information."""
|
|
name: Optional[str] = None
|
|
description: Optional[str] = None
|
|
|
|
|
|
class MapResponse(MapBase):
|
|
"""Response schema for map data."""
|
|
id: UUID
|
|
owner_id: UUID
|
|
is_default_public: bool
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|