Gift packages: buy a main package for someone, with a printable gift card

- /ajandek: the package, whom it is for and from whom, the recipient's
  address typed twice (or "I hand it over"), a message; paid on Stripe
  like any package, the invoice is the buyer's
- On payment the gift gets its own code (not a promo code: it cannot be
  withdrawn, and it adds the whole package); redeemed on /bevaltas
- The recipient's e-mail carries the message and the code, with the gift
  card attached as a PDF; the buyer's confirmation says it was a gift
- /ajandekaim: codes, state, the card to download, sending it by e-mail
  (again, or to another address) up to three times
- crates/gift-card draws the A4 card (example chart, questions avatar,
  QR code) as SVG and makes a PDF with krilla, fonts compiled in; the
  backend draws downloads on a blocking thread, the worker the e-mails
- Telegram notices say "(ajándék)"; unpaid gifts go after a week

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-23 20:28:11 +00:00
co-authored by Claude Opus 5.5
parent 699ce2abbd
commit c90232f40c
46 changed files with 3647 additions and 88 deletions
+23
View File
@@ -633,6 +633,29 @@ export interface PromoCode {
redeemed_by: { email: string; name: string | null } | null;
}
/** A package the user bought as a gift (`GET /v1/gifts`). */
export interface Gift {
id: string;
package: { id: string; name: string | null };
/** Whom it is for (on the card: "Bea részére"). */
recipient_name: string | null;
/** Where it was e-mailed (null: the buyer hands it over). */
recipient_email: string | null;
from_name: string | null;
message: string | null;
paid_at: string;
/** ABCD-EFGH-JKLM */
code: string;
status: "open" | "redeemed";
redeemed_at: string | null;
/** E-mails sent so far. */
sendings: number;
/** Whether it can be sent by e-mail (again). */
can_send: boolean;
/** Not before this (just sent). */
send_again_at: string | null;
}
/** A "how compatible are we?" invitation of the user (`GET /v1/invites`). */
export interface PersonInvite {
id: string;