Invitations with a package; promo codes fill up the balance
CI / test (push) Successful in 1m15s
CI / build (push) Successful in 5m15s
CI / deploy (push) Skipped

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:
feco
2026-11-19 09:57:01 +00:00
co-authored by Claude Opus 5.5
parent 054fb930f5
commit 7b23d71526
13 changed files with 458 additions and 66 deletions
+4
View File
@@ -413,6 +413,8 @@ export interface AdminInvitation {
mail: "sent" | "queued" | "failed" | "archived";
mail_error: string | null;
can_resend: boolean;
/** The package it comes with (a promo code, redeemed at sign-up). */
package: { id: string; name: string | null; code: string | null; redeemed_at: string | null } | null;
}
export interface WaitlistEntry {
@@ -428,6 +430,8 @@ export interface InvitationResult {
status: "invited" | "invalid" | "already_user" | "already_invited" | "opted_out";
id?: string;
url?: string;
/** The promo code of the package sent with it. */
promo_code?: string | null;
}
/** A calculated year in a list (`GET /v1/charts/{id}/forecasts`). */