a working product with ugly ui
This commit is contained in:
43
app/schemas/share.py
Normal file
43
app/schemas/share.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
class ShareBase(BaseModel):
|
||||
"""Base share schema with common attributes."""
|
||||
access_level: str # 'read_only', 'edit', 'guest_read_only'
|
||||
requires_auth: bool = True
|
||||
expires_at: Optional[datetime] = None
|
||||
|
||||
|
||||
class ShareCreate(ShareBase):
|
||||
"""Schema for creating a new share link."""
|
||||
pass
|
||||
|
||||
|
||||
class ShareUpdate(BaseModel):
|
||||
"""Schema for updating share information."""
|
||||
access_level: Optional[str] = None
|
||||
requires_auth: Optional[bool] = None
|
||||
expires_at: Optional[datetime] = None
|
||||
|
||||
|
||||
class ShareResponse(ShareBase):
|
||||
"""Response schema for share data."""
|
||||
id: UUID
|
||||
map_id: UUID
|
||||
share_token: str
|
||||
created_at: datetime
|
||||
created_by: Optional[UUID] = None
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class ShareValidateResponse(BaseModel):
|
||||
"""Response schema for share token validation."""
|
||||
valid: bool
|
||||
access_level: Optional[str] = None
|
||||
map_id: Optional[UUID] = None
|
||||
requires_auth: bool = False
|
||||
expired: bool = False
|
||||
Reference in New Issue
Block a user