2026-11-20 14:35:50 +00:00
|
|
|
/** The tarot deck and spreads (the backend draws from the same deck file). */
|
|
|
|
|
|
|
|
|
|
import deckData from "@/content/tarot-deck.json";
|
|
|
|
|
|
|
|
|
|
export type TarotSuit = "major" | "wands" | "cups" | "swords" | "pentacles";
|
|
|
|
|
export type TarotElement = "Tűz" | "Víz" | "Levegő" | "Föld" | "Éter";
|
|
|
|
|
export type MinorRank = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | "page" | "knight" | "queen" | "king";
|
|
|
|
|
|
|
|
|
|
export interface TarotCardData {
|
|
|
|
|
id: string;
|
|
|
|
|
number: number;
|
|
|
|
|
roman?: string;
|
|
|
|
|
rank?: MinorRank;
|
|
|
|
|
nameHu: string;
|
|
|
|
|
nameEn: string;
|
|
|
|
|
suit: TarotSuit;
|
|
|
|
|
suitLabelHu: string;
|
|
|
|
|
element: TarotElement;
|
|
|
|
|
astroRuler: string;
|
|
|
|
|
astroGlyph: string;
|
|
|
|
|
keywords: string[];
|
|
|
|
|
upright: string;
|
|
|
|
|
reversed: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const DECK = deckData as TarotCardData[];
|
|
|
|
|
|
|
|
|
|
export function tarotCard(id: string): TarotCardData | undefined {
|
|
|
|
|
return DECK.find((c) => c.id === id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type SpreadId = "daily" | "trinity" | "astro_cross";
|
|
|
|
|
|
|
|
|
|
/** The spreads to choose from (the positions come with the reading). */
|
|
|
|
|
export const SPREADS: { id: SpreadId; name: string; cards: number; about: string }[] = [
|
|
|
|
|
{ id: "daily", name: "Napi iránymutatás", cards: 1, about: "Egy lap: mire hangolódj ma." },
|
|
|
|
|
{ id: "trinity", name: "Sorsfonalak hármas", cards: 3, about: "Három lap: előzmény, jelen, kibontakozás." },
|
|
|
|
|
{
|
|
|
|
|
id: "astro_cross",
|
|
|
|
|
name: "Képlet-kereszt",
|
|
|
|
|
cards: 5,
|
|
|
|
|
about: "Öt lap: központi téma, belső és tudatos erők, kihívás, útmutatás.",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
2026-11-20 16:25:12 +00:00
|
|
|
export type TopicId = "general" | "love" | "work" | "self";
|
|
|
|
|
|
|
|
|
|
/** What a reading is about (the backend's `TOPICS`), with an example question. */
|
|
|
|
|
export const TOPICS: { id: TopicId; name: string; example: string }[] = [
|
|
|
|
|
{ id: "general", name: "Általános", example: "Pl. Mire figyeljek a következő hetekben?" },
|
|
|
|
|
{ id: "love", name: "Párkapcsolat", example: "Pl. Mit tehetek azért, hogy közelebb kerüljünk egymáshoz?" },
|
|
|
|
|
{ id: "work", name: "Munka és hivatás", example: "Pl. Mire figyeljek, ha munkahelyet váltanék?" },
|
|
|
|
|
{ id: "self", name: "Önismeret", example: "Pl. Mit tanulhatok most önmagamról?" },
|
|
|
|
|
];
|
|
|
|
|
|
2026-11-20 14:35:50 +00:00
|
|
|
/** Longest question (the backend's `TAROT_QUESTION_MAX_CHARS`). */
|
|
|
|
|
export const TAROT_QUESTION_MAX = 300;
|
|
|
|
|
|
|
|
|
|
export interface TarotContent {
|
|
|
|
|
title: string;
|
|
|
|
|
summary: string;
|
|
|
|
|
cards: { body: string }[];
|
|
|
|
|
synthesis: string;
|
|
|
|
|
advice: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** A reading (`/v1/tarot/readings`). */
|
|
|
|
|
export interface TarotReading {
|
|
|
|
|
id: string;
|
|
|
|
|
status: "pending" | "running" | "done" | "failed";
|
|
|
|
|
spread: SpreadId;
|
|
|
|
|
spread_name: string | null;
|
2026-11-20 16:25:12 +00:00
|
|
|
topic: TopicId | null;
|
|
|
|
|
topic_name: string | null;
|
2026-11-20 14:35:50 +00:00
|
|
|
question: string | null;
|
|
|
|
|
cards: { card: string; reversed: boolean; position: string | null; about: string | null }[];
|
|
|
|
|
content: TarotContent | null;
|
|
|
|
|
error: string | null;
|
|
|
|
|
credits_charged: number;
|
|
|
|
|
attempts: number;
|
|
|
|
|
created_at: string;
|
|
|
|
|
completed_at: string | null;
|
|
|
|
|
}
|