Files
sorsfonalak/services/frontend/src/app/bevaltas/page.tsx
T
fecoandClaude Opus 5.5 c90232f40c 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
2026-11-23 20:28:11 +00:00

34 lines
1.3 KiB
TypeScript

import type { Metadata } from "next";
import { RedeemCode } from "@/components/RedeemCode";
import { requireMe } from "@/lib/server";
export const metadata: Metadata = { title: "Kód beváltása", robots: { index: false } };
type Props = { searchParams: Promise<{ kod?: string }> };
/** Redeeming a promo or gift code; `?kod=` fills it in (links in invitations and gift e-mails). */
export default async function RedeemPage({ searchParams }: Props) {
const { kod } = await searchParams;
await requireMe(kod ? `/bevaltas?kod=${encodeURIComponent(kod)}` : "/bevaltas");
return (
<main className="page" style={{ maxWidth: 640 }}>
<div className="page-head">
<span className="eyebrow">Promókód, ajándékkód</span>
<h1>Kód beváltása</h1>
<p className="muted">
Írd be a kapott kódot. Egy kód egyszer váltható be. Az ajándékba kapott csomag teljes egészében hozzáadódik
az egyenlegedhez.
</p>
<p className="hint">
Promókódnál az egyenlegedet a csomag szintjéig töltjük fel: amit már elhasználtál belőle, visszakapod, ami
ennél több van, megmarad.
</p>
</div>
<section className="card">
<RedeemCode initial={kod ?? ""} />
</section>
</main>
);
}