feat(backend): invite system + user management

- 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>
This commit is contained in:
2026-03-13 17:37:06 +02:00
parent 5fa72e4323
commit 8c0346e41f
10 changed files with 345 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ from app.db.models.catalog import (
from app.db.models.invoice import Invoice
from app.db.models.appointment import Appointment
from app.db.models.mecanic import Mecanic
from app.db.models.invite import InviteToken
__all__ = [
"Tenant",
@@ -32,4 +33,5 @@ __all__ = [
"Invoice",
"Appointment",
"Mecanic",
"InviteToken",
]