from pydantic import BaseModel class OAuthCallbackPayload(BaseModel): code: str state: str | None = None # When the OAuth flow originated from /accept-invite, the frontend round-trips # the invite code + invited email so the backend can link the new user to the # invited account instead of creating a personal one. account_invite_code: str | None = None invited_email: str | None = None class OAuthCallbackResponse(BaseModel): access_token: str refresh_token: str token_type: str = "bearer" is_new_user: bool class InviteLookupResponse(BaseModel): """Public response surface for GET /accounts/invites/{code}/lookup. Returns the minimum context needed for the AcceptInvitePage: account name (so we can title the card), inviter name (for the resend fallback message), invited email (locked into the form), and role. """ account_name: str inviter_name: str invited_email: str role: str