A fixed catalog (packages.rs, reasoning in docs/csomagok.md): Egy elemzés
2 990 Ft, Páros 6 990 Ft, Család 11 990 Ft (featured), Korlátlan 17 990 Ft
for a year, and two top-ups. Every grant is a package_orders row; units are
credit_ledger rows with reason 'package' and never expire. The unlimited
package is a time-limited 'unlimited' entitlement: analyses use no unit and
persons have no limit, with a daily fair-use cap (UNLIMITED_DAILY_LIMIT, 5);
buying it again extends it by a year.
- GET /v1/packages, mock payment by package id, /v1/me unlimited_until
- POST /v1/admin/users/{id}/packages: give a package as a gift
- /csomagok page; the paid step of an analysis offers three packages with
the bigger one featured; person packs use the catalog; admin user list
has a package column
- PERSON_PACK_SIZE is replaced by the catalog's +5 személy top-up
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import type { Metadata } from "next";
|
|
|
|
import { PersonPacks } from "@/components/PersonPacks";
|
|
import { backendGet, requireMe } from "@/lib/server";
|
|
import type { PublicConfig } from "@/lib/types";
|
|
|
|
import { NewPerson } from "./NewPerson";
|
|
|
|
export const metadata: Metadata = { title: "Új személy" };
|
|
|
|
export default async function NewPersonPage() {
|
|
const me = await requireMe("/szemelyek/uj");
|
|
const config = await backendGet<PublicConfig>("/v1/config");
|
|
const slots = me.persons;
|
|
|
|
return (
|
|
<main className="page">
|
|
<div className="page-head">
|
|
<h1>Új személy</h1>
|
|
<p className="muted">
|
|
Társad, családtagod, barátod: a születési adataiból elkészül a képlete és egy rövid összefoglaló.
|
|
{!slots.unlimited && slots.left !== null && slots.left > 0 && ` Még ${slots.left} személyt vehetsz fel.`}
|
|
</p>
|
|
</div>
|
|
<section className="card" aria-label="Születési adatok">
|
|
{slots.left === 0 ? (
|
|
<>
|
|
<p className="muted">Elfogytak a helyeid. Újabb személyhez válassz csomagot.</p>
|
|
<PersonPacks canPay={config?.mock_payments ?? false} />
|
|
</>
|
|
) : (
|
|
<>
|
|
<NewPerson />
|
|
<p className="hint">Az adatokat a felvételt követő egy órán belül még javíthatod, utána nem módosíthatók.</p>
|
|
</>
|
|
)}
|
|
</section>
|
|
</main>
|
|
);
|
|
}
|