Allows event owners to grant individual invitees edit permission via a toggle in the invitee list. Invited editors can modify event details (title, description, time, location) but cannot change calendars, manage invitees, delete events, or bulk-edit recurring series (scope restricted to "this" only). The can_modify flag resets on decline to prevent silent re-grant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
from typing import Annotated, Literal, Optional
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class EventInvitationCreate(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
user_ids: list[Annotated[int, Field(ge=1, le=2147483647)]] = Field(..., min_length=1, max_length=20)
|
|
|
|
|
|
class EventInvitationRespond(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
status: Literal["accepted", "tentative", "declined"]
|
|
|
|
|
|
class EventInvitationOverrideCreate(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
status: Literal["accepted", "tentative", "declined"]
|
|
|
|
|
|
class UpdateDisplayCalendar(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
calendar_id: Annotated[int, Field(ge=1, le=2147483647)]
|
|
|
|
|
|
class UpdateCanModify(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
can_modify: bool
|
|
|
|
|
|
class EventInvitationResponse(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
event_id: int
|
|
user_id: int
|
|
invited_by: Optional[int]
|
|
status: str
|
|
invited_at: datetime
|
|
responded_at: Optional[datetime]
|
|
invitee_name: Optional[str] = None
|
|
invitee_umbral_name: Optional[str] = None
|
|
display_calendar_id: Optional[int] = None
|
|
can_modify: bool = False
|