Tarot readings: AI-written, drawn on the server, sold as units
CI / test (push) Successful in 1m29s
CI / build (push) Successful in 5m52s
CI / deploy (push) Skipped

A new Kártyajóslás page: choose a spread (1, 3 or 5 cards), ask a
question, pick the cards from the fanned deck and watch them turn over;
the reading is written by the detailed-analysis model from the cards,
their positions and base meanings, the question and the reader's Sun,
Moon and Ascendant. The server shuffles and draws, so nobody can draw
again for free. A reading is a 'tarot' analysis (worker, retries,
fallback, refunds and admin regeneration as for analyses), uses one
'tarot' unit, and survives recalculations; deleting the account
deletes it.

Packages carry 2/5/10 readings, the new +5 kártyajóslás addon costs
1 000 Ft. The card artwork comes from the tarot design studio
(celestial astrolabe style); the deck JSON is shared by the frontend
and the prompt. A public example is at /kartyajoslas/pelda.

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-20 14:35:50 +00:00
co-authored by Claude Opus 5.5
parent 54af54cd39
commit b0fc547b73
36 changed files with 2957 additions and 46 deletions
+31 -4
View File
@@ -45,11 +45,13 @@ pub struct Package {
pub persons: i64,
/// Questions about the user's analyses and forecasts.
pub questions: i64,
/// Tarot readings.
pub tarot: i64,
/// Badge on the card ("Legnépszerűbb").
pub badge: Option<&'static str>,
}
pub const CATALOG: [Package; 7] = [
pub const CATALOG: [Package; 8] = [
Package {
id: "single",
name: "Egy elemzés",
@@ -61,6 +63,7 @@ pub const CATALOG: [Package; 7] = [
forecast: 0,
persons: 0,
questions: QUESTIONS_INCLUDED,
tarot: 2,
badge: None,
},
Package {
@@ -74,6 +77,7 @@ pub const CATALOG: [Package; 7] = [
forecast: 2,
persons: 1,
questions: QUESTIONS_INCLUDED,
tarot: 5,
badge: None,
},
Package {
@@ -87,6 +91,7 @@ pub const CATALOG: [Package; 7] = [
forecast: 6,
persons: 5,
questions: QUESTIONS_INCLUDED,
tarot: 10,
badge: Some("Legnépszerűbb"),
},
Package {
@@ -100,6 +105,7 @@ pub const CATALOG: [Package; 7] = [
forecast: 0,
persons: 0,
questions: 0,
tarot: 0,
badge: None,
},
Package {
@@ -113,6 +119,7 @@ pub const CATALOG: [Package; 7] = [
forecast: 1,
persons: 0,
questions: 0,
tarot: 0,
badge: None,
},
Package {
@@ -126,6 +133,7 @@ pub const CATALOG: [Package; 7] = [
forecast: 0,
persons: 5,
questions: 0,
tarot: 0,
badge: None,
},
Package {
@@ -139,6 +147,21 @@ pub const CATALOG: [Package; 7] = [
forecast: 0,
persons: 0,
questions: 5,
tarot: 0,
badge: None,
},
Package {
id: "addon_tarot",
name: "+5 kártyajóslás",
tagline: "Öt újabb kártyajóslás a saját kérdéseidre.",
tier: Tier::Addon,
price_huf: 1_000,
natal: 0,
synastry: 0,
forecast: 0,
persons: 0,
questions: 0,
tarot: 5,
badge: None,
},
];
@@ -171,6 +194,7 @@ impl Package {
"forecast": self.forecast,
"persons": self.persons,
"questions": self.questions,
"tarot": self.tarot,
"badge": self.badge,
"list_price_huf": list,
"savings_percent": savings,
@@ -210,6 +234,7 @@ impl Package {
(self.forecast, "éves előrejelzés"),
(self.persons, "személyhely"),
(self.questions, "kérdés"),
(self.tarot, "kártyajóslás"),
]
.into_iter()
.filter(|&(n, _)| n > 0)
@@ -232,6 +257,7 @@ impl Package {
(self.forecast, "éves előrejelzés"),
(self.persons, "további személy felvétele"),
(self.questions, "kérdés"),
(self.tarot, "kártyaértelmezés"),
]
.into_iter()
.filter(|&(n, _)| n > 0)
@@ -246,13 +272,14 @@ impl Package {
}
/// What the package gives, unit by unit.
pub fn contents(&self) -> [(Unit, i64); 5] {
pub fn contents(&self) -> [(Unit, i64); 6] {
[
(Unit::Natal, self.natal),
(Unit::Synastry, self.synastry),
(Unit::Forecast, self.forecast),
(Unit::Person, self.persons),
(Unit::Question, self.questions),
(Unit::Tarot, self.tarot),
]
}
}
@@ -392,8 +419,8 @@ mod tests {
assert_eq!(
comment,
"Hozzáférés a sorsfonalak.hu szoftveresen előállított, személyre szabott szöveges tartalmaihoz: \
2 képletelemzés, 1 kapcsolati elemzés, 2 éves előrejelzés, 1 további személy felvétele, 3 kérdés. \
Digitális tartalom."
2 képletelemzés, 1 kapcsolati elemzés, 2 éves előrejelzés, 1 további személy felvétele, 3 kérdés, \
5 kártyaértelmezés. Digitális tartalom."
);
let (name, comment) = find("addon_persons").unwrap().invoice_item();
assert_eq!(name, "Online tartalomszolgáltatás – +5 személy kiegészítő");