Skip to content

Add team invite by email#14

Merged
alejandro-runner merged 1 commit intosynvya-stagingfrom
feature/team-invite-by-email
Apr 13, 2026
Merged

Add team invite by email#14
alejandro-runner merged 1 commit intosynvya-stagingfrom
feature/team-invite-by-email

Conversation

@alejandro-runner
Copy link
Copy Markdown
Member

Summary

  • Adds email-based team invitations: admins invite by email, existing users are added instantly, new users receive an invitation email with a 7-day token
  • Five new endpoints: invite, list, revoke, preview (public), accept (authenticated)
  • Adds team_invitations table with partial unique index for pending invites
  • Adds send_team_invite_email to all email providers (SendGrid, SES, Dev)
  • Fixes cloudbuild.yaml migration glob to pick up date-based filenames

Test plan

  • Run migration locally: psql -f database/migrations/20260413000000_add_team_invitations.sql
  • Test invite existing user (instant add) via POST /teams/:id/invite
  • Test invite new user (email sent) via POST /teams/:id/invite
  • Test preview endpoint returns team name and role without auth
  • Test accept endpoint verifies email match and adds to team
  • Test revoke sets revoked_at and blocks subsequent accept
  • Test duplicate invite returns 409
  • Verify cargo check, cargo fmt, cargo clippy pass

🤖 Generated with Claude Code

Implements email-based team invitations so restaurant admins can invite
team members by email instead of requiring Nostr public keys. Existing
users are added immediately; new users receive an invitation email with
a token-based accept flow.

New endpoints:
- POST /teams/:id/invite (instant add or send invitation)
- GET /teams/:id/invitations (list invitations)
- DELETE /teams/:id/invitations/:id (revoke)
- GET /invitations/preview?token= (public preview)
- POST /invitations/accept (accept with auth)

Also fixes cloudbuild.yaml migration glob to pick up date-based
migration filenames (20260413... pattern).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alejandro-runner alejandro-runner merged commit 37b24b7 into synvya-staging Apr 13, 2026
@alejandro-runner alejandro-runner deleted the feature/team-invite-by-email branch April 13, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant