- InviteToken model with unique token for each invite
- POST /users/invite - create invite by email with role (admin/mecanic)
- POST /auth/accept-invite - accept invite, set password, return JWT
- GET /users - list all users in tenant
- DELETE /users/{id} - deactivate user (cannot deactivate owner)
- Alembic migration for invites table
- 25 passing tests (auth + sync + orders + pdf + portal + invoices + users)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
193 B
Python
12 lines
193 B
Python
from pydantic import BaseModel, EmailStr
|
|
|
|
|
|
class InviteRequest(BaseModel):
|
|
email: EmailStr
|
|
rol: str = "mecanic"
|
|
|
|
|
|
class AcceptInviteRequest(BaseModel):
|
|
token: str
|
|
password: str
|