0e9b20ec37
Three strands of work that grew together across the same settings screen and
API client, so they land as one change.
Per-year preschool planning days ("studiedagar"): new table, repository
(SQLite + Postgres), service, router and migration 007, plus the hooks and
Settings UI to plan and record them per child and year. Allocation now
reserves the recorded figure for a year where one exists and only falls back
to the child-level estimate otherwise, marking that fallback as assumed.
Partner invitations: workspaces issue and list invitations, registration
accepts an invite token to join the inviter's workspace instead of creating a
personal one, and a /join/:token page plus the settings invite panel drive it.
Vacation forfeiture: tips and the dashboard now distinguish days a parent
genuinely loses from days that merely age, so the warning stops firing on
balances that were never at risk.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
33 lines
880 B
Python
33 lines
880 B
Python
"""Pydantic schemas for auth endpoints."""
|
|
|
|
from pydantic import BaseModel, EmailStr, Field
|
|
|
|
|
|
class RegisterRequest(BaseModel):
|
|
email: EmailStr
|
|
password: str = Field(min_length=8)
|
|
display_name: str = Field(min_length=1, max_length=100)
|
|
# Optional: lets a partner register straight from an invite link instead
|
|
# of first creating a throwaway solo workspace. When present, `register`
|
|
# joins the inviting workspace directly (claiming a placeholder member
|
|
# if one exists) instead of creating a new one.
|
|
invite_token: str | None = None
|
|
|
|
|
|
class LoginRequest(BaseModel):
|
|
email: EmailStr
|
|
password: str
|
|
|
|
|
|
class TokenResponse(BaseModel):
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
expires_in: int # seconds until expiry
|
|
|
|
|
|
class UserMeResponse(BaseModel):
|
|
id: str
|
|
email: str
|
|
display_name: str
|
|
workspace_id: str | None
|