Questions about an analysis or forecast, answered by the model that wrote it
- 3 questions in every package, +5 questions add-on (1 000 Ft); question units, refund on failure - The answer sees the chart data, the analysis and earlier questions; at most 250 words - Editable question prompt (Promptok → Kérdés-válasz); admins regenerate answers - Package texts and FAQ updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -19,6 +19,9 @@ const SYNASTRY_PRICE: i64 = 2_500;
|
||||
/// A yearly forecast bought alone costs more than one in a package.
|
||||
const FORECAST_PRICE: i64 = 2_500;
|
||||
const PERSON_PRICE: i64 = 300; // 1 500 Ft for five
|
||||
/// Questions every package of the main ladder comes with (not counted in the
|
||||
/// "bought one by one" price: they are a bonus).
|
||||
const QUESTIONS_INCLUDED: i64 = 3;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Tier {
|
||||
@@ -40,11 +43,13 @@ pub struct Package {
|
||||
pub synastry: i64,
|
||||
pub forecast: i64,
|
||||
pub persons: i64,
|
||||
/// Questions about the user's analyses and forecasts.
|
||||
pub questions: i64,
|
||||
/// Badge on the card ("Legnépszerűbb").
|
||||
pub badge: Option<&'static str>,
|
||||
}
|
||||
|
||||
pub const CATALOG: [Package; 6] = [
|
||||
pub const CATALOG: [Package; 7] = [
|
||||
Package {
|
||||
id: "single",
|
||||
name: "Egy elemzés",
|
||||
@@ -55,6 +60,7 @@ pub const CATALOG: [Package; 6] = [
|
||||
synastry: 0,
|
||||
forecast: 0,
|
||||
persons: 0,
|
||||
questions: QUESTIONS_INCLUDED,
|
||||
badge: None,
|
||||
},
|
||||
Package {
|
||||
@@ -67,6 +73,7 @@ pub const CATALOG: [Package; 6] = [
|
||||
synastry: 1,
|
||||
forecast: 2,
|
||||
persons: 1,
|
||||
questions: QUESTIONS_INCLUDED,
|
||||
badge: None,
|
||||
},
|
||||
Package {
|
||||
@@ -79,6 +86,7 @@ pub const CATALOG: [Package; 6] = [
|
||||
synastry: 5,
|
||||
forecast: 6,
|
||||
persons: 5,
|
||||
questions: QUESTIONS_INCLUDED,
|
||||
badge: Some("Legnépszerűbb"),
|
||||
},
|
||||
Package {
|
||||
@@ -91,6 +99,7 @@ pub const CATALOG: [Package; 6] = [
|
||||
synastry: 1,
|
||||
forecast: 0,
|
||||
persons: 0,
|
||||
questions: 0,
|
||||
badge: None,
|
||||
},
|
||||
Package {
|
||||
@@ -103,6 +112,7 @@ pub const CATALOG: [Package; 6] = [
|
||||
synastry: 0,
|
||||
forecast: 1,
|
||||
persons: 0,
|
||||
questions: 0,
|
||||
badge: None,
|
||||
},
|
||||
Package {
|
||||
@@ -115,6 +125,20 @@ pub const CATALOG: [Package; 6] = [
|
||||
synastry: 0,
|
||||
forecast: 0,
|
||||
persons: 5,
|
||||
questions: 0,
|
||||
badge: None,
|
||||
},
|
||||
Package {
|
||||
id: "addon_questions",
|
||||
name: "+5 kérdés",
|
||||
tagline: "Öt újabb kérdés az elemzéseidről és előrejelzéseidről.",
|
||||
tier: Tier::Addon,
|
||||
price_huf: 1_000,
|
||||
natal: 0,
|
||||
synastry: 0,
|
||||
forecast: 0,
|
||||
persons: 0,
|
||||
questions: 5,
|
||||
badge: None,
|
||||
},
|
||||
];
|
||||
@@ -146,6 +170,7 @@ impl Package {
|
||||
"synastry": self.synastry,
|
||||
"forecast": self.forecast,
|
||||
"persons": self.persons,
|
||||
"questions": self.questions,
|
||||
"badge": self.badge,
|
||||
"list_price_huf": list,
|
||||
"savings_percent": savings,
|
||||
@@ -202,6 +227,7 @@ pub async fn grant(
|
||||
(Unit::Synastry, package.synastry),
|
||||
(Unit::Forecast, package.forecast),
|
||||
(Unit::Person, package.persons),
|
||||
(Unit::Question, package.questions),
|
||||
];
|
||||
for (unit, n) in contents {
|
||||
if n == 0 {
|
||||
@@ -254,5 +280,8 @@ mod tests {
|
||||
assert!(find("single").unwrap().view()["savings_percent"].is_null());
|
||||
assert!(find("unlimited").is_none());
|
||||
assert!(CATALOG.iter().all(|p| find(p.id).is_some()));
|
||||
// Every package of the ladder comes with questions; more can be bought.
|
||||
assert!(CATALOG.iter().filter(|p| p.tier == Tier::Main).all(|p| p.questions == QUESTIONS_INCLUDED));
|
||||
assert_eq!(find("addon_questions").unwrap().questions, 5);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user