video-accessibility/backend/app/models
Vadym Samoilenko 00fb1aacc6 feat(saas): Phase 2 — invitation flow, email templates, MS SSO zero-membership
Backend:
- models/invitation.py — Invitation model + create/accept/preview schemas
- routes_invitations.py — org-scoped POST/GET/DELETE + public preview/accept endpoints
  Single-use token via find_one_and_update; sha256(token) stored in DB, plaintext in email URL
- emailer.py — _send() helper; send_invitation_email, send_welcome_email, send_password_reset_email
  send_completion_email refactored to use _send()
- migration_2026-04-28-000002 — creates invitations collection with TTL index (30d audit trail)
- routes_auth.py — new MS SSO users provisioned with zero memberships instead of role=PRODUCTION;
  they land on "no access" page until an admin invites them
- main.py — registers invitations_org_router and invitations_router

Frontend:
- routes/AcceptInvite.tsx — public page at /accept-invite?token=...
  Four states: new user (name+password), existing user (confirm), MS user, already-member
- App.tsx — /accept-invite route outside RequireAuth
- types/api.ts — Invitation, InvitationCreate, InvitationPreview, InvitationAcceptRequest/Response
- lib/api.ts — listInvitations, createInvitation, revokeInvitation, previewInvitation, acceptInvitation
- hooks/useClients.ts — useInvitations, useCreateInvitation, useRevokeInvitation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 16:52:08 +01:00
..
__pycache__ initial commit 2025-08-24 16:28:33 -05:00
audit_log.py initial commit 2025-08-24 16:28:33 -05:00
client.py fix: serialize Client/Team/Project with id not _id + guard undefined client hooks 2026-04-27 16:18:28 +01:00
invitation.py feat(saas): Phase 2 — invitation flow, email templates, MS SSO zero-membership 2026-04-27 16:52:08 +01:00
job.py feat: Client → Team → Project isolation system with Project Manager role 2026-04-27 15:11:13 +01:00
membership.py feat(saas): Phase 0+1 — Organization/Membership entities and dev branch 2026-04-27 16:46:24 +01:00
organization.py feat(saas): Phase 0+1 — Organization/Membership entities and dev branch 2026-04-27 16:46:24 +01:00
review_note.py feat: add video review with timestamped notes to Final Review 2025-12-26 15:30:00 -06:00
user.py feat: Client → Team → Project isolation system with Project Manager role 2026-04-27 15:11:13 +01:00