regirstation works but shared links broken
This commit is contained in:
53
app/schemas/map_share.py
Normal file
53
app/schemas/map_share.py
Normal file
@@ -0,0 +1,53 @@
|
||||
"""Schemas for map sharing."""
|
||||
from pydantic import BaseModel
|
||||
from uuid import UUID
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from app.models.map_share import SharePermission
|
||||
|
||||
|
||||
class MapShareCreate(BaseModel):
|
||||
"""Schema for creating a map share with a specific user."""
|
||||
user_id: UUID
|
||||
permission: SharePermission = SharePermission.READ
|
||||
|
||||
|
||||
class MapShareUpdate(BaseModel):
|
||||
"""Schema for updating map share permissions."""
|
||||
permission: SharePermission
|
||||
|
||||
|
||||
class MapShareResponse(BaseModel):
|
||||
"""Schema for map share response."""
|
||||
id: UUID
|
||||
map_id: UUID
|
||||
user_id: UUID
|
||||
permission: SharePermission
|
||||
shared_by: Optional[UUID]
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class MapShareLinkCreate(BaseModel):
|
||||
"""Schema for creating a public share link."""
|
||||
permission: SharePermission = SharePermission.READ
|
||||
expires_at: Optional[datetime] = None
|
||||
|
||||
|
||||
class MapShareLinkResponse(BaseModel):
|
||||
"""Schema for share link response."""
|
||||
id: UUID
|
||||
map_id: UUID
|
||||
token: str
|
||||
permission: SharePermission
|
||||
is_active: bool
|
||||
created_by: Optional[UUID]
|
||||
expires_at: Optional[datetime]
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user