Invitations with a package; promo codes fill up the balance
An admin can pick a package when inviting: each invitee gets a promo code (in the e-mail and its preview, kept on resend), redeemed by itself at sign up; revoking the invitation withdraws it, and the list shows the package. Redeeming a promo code now fills the units up to the package's amounts: used units come back, more than that stays. A code that would add nothing stays open, with a message saying so; the answer tells what was added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -216,7 +216,14 @@ pub async fn register(
|
||||
.bind(&email)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
super::invitations::mark_accepted(&mut tx, user_id, &email, req.invite_token.as_deref()).await?;
|
||||
super::invitations::mark_accepted(
|
||||
&mut tx,
|
||||
user_id,
|
||||
&email,
|
||||
req.invite_token.as_deref(),
|
||||
state.config.free_person_slots,
|
||||
)
|
||||
.await?;
|
||||
let mut user = load_user(&mut tx, user_id).await?;
|
||||
apply_bootstrap_admin(&state, &mut tx, &mut user).await?;
|
||||
queue_verification(&state, &mut tx, &user).await?;
|
||||
@@ -347,7 +354,14 @@ pub async fn google(
|
||||
.bind(locale)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
super::invitations::mark_accepted(&mut tx, id, &email, req.invite_token.as_deref()).await?;
|
||||
super::invitations::mark_accepted(
|
||||
&mut tx,
|
||||
id,
|
||||
&email,
|
||||
req.invite_token.as_deref(),
|
||||
state.config.free_person_slots,
|
||||
)
|
||||
.await?;
|
||||
(id, true)
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user