New prices: a forecast in the single package, cheaper Páros, Család and add-ons

- Egy elemzés: 2 000 Ft, now with a yearly forecast.
- Páros 5 000 Ft, Család 7 000 Ft, +1 kapcsolati and +1 előrejelzés 1 500 Ft.

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-24 18:17:38 +00:00
co-authored by Claude Opus 5.5
parent 5feaa6836c
commit e6aacd0baa
4 changed files with 32 additions and 33 deletions
+7 -7
View File
@@ -1350,7 +1350,7 @@ async fn admins_use_units_too_and_mock_payments_add_units(pool: PgPool) {
let r = app.post("/v1/payments/mock", Some(&anna), json!({"unit": "natal"})).await;
assert_eq!(
(r.status, &r.body["analyses_left"]),
(StatusCode::OK, &json!({"natal": 1, "synastry": 0, "forecast": 0, "question": 3, "tarot": 2})),
(StatusCode::OK, &json!({"natal": 1, "synastry": 0, "forecast": 1, "question": 3, "tarot": 2})),
"{}",
r.body
);
@@ -1359,7 +1359,7 @@ async fn admins_use_units_too_and_mock_payments_add_units(pool: PgPool) {
assert_eq!((r.status, &r.body["credits_charged"]), (StatusCode::ACCEPTED, &json!(1)), "{}", r.body);
assert_eq!(
app.get("/v1/credits", Some(&anna)).await.body["balance"],
json!({"natal": 0, "synastry": 0, "forecast": 0, "question": 3, "tarot": 2})
json!({"natal": 0, "synastry": 0, "forecast": 1, "question": 3, "tarot": 2})
);
// without MOCK_PAYMENTS there is no such payment
@@ -1663,7 +1663,7 @@ async fn packages_grant_units(pool: PgPool) {
);
assert_eq!(
(&r.body["packages"][2]["badge"], &r.body["packages"][2]["per_analysis_huf"]),
(&json!("Legnépszerűbb"), &json!(647))
(&json!("Legnépszerűbb"), &json!(412))
);
// an admin gives a package as a gift
@@ -1703,7 +1703,7 @@ async fn packages_grant_units(pool: PgPool) {
);
let (price,): (i32,) =
sqlx::query_as("SELECT price_huf FROM package_orders WHERE package = 'couple'").fetch_one(&pool).await.unwrap();
assert_eq!(price, 6000);
assert_eq!(price, 5000);
// the header shows the latest main package; a top-up does not change it
app.post("/v1/payments/mock", Some(&anna), json!({"package": "addon_persons"})).await;
assert_eq!(app.get("/v1/me", Some(&anna)).await.body["package"]["name"], "Páros");
@@ -2632,7 +2632,7 @@ async fn stripe_checkout_grants_the_paid_package_once(pool: PgPool) {
let url = r.body["url"].as_str().unwrap();
let id = url.rsplit('/').next().unwrap().to_string();
assert_eq!(stripe_form(&id, "line_items[0][price_data][currency]").as_deref(), Some("huf"));
assert_eq!(stripe_form(&id, "line_items[0][price_data][unit_amount]").as_deref(), Some("600000"));
assert_eq!(stripe_form(&id, "line_items[0][price_data][unit_amount]").as_deref(), Some("500000"));
assert_eq!(
stripe_form(&id, "line_items[0][price_data][product_data][name]").as_deref(),
Some("Sorsfonalak – Páros")
@@ -2694,7 +2694,7 @@ async fn stripe_checkout_grants_the_paid_package_once(pool: PgPool) {
.await;
assert_eq!(r.status, StatusCode::OK, "{}", r.body);
}
assert_eq!(stripe_orders(&app.pool, "anna@example.com").await, vec![("couple".to_string(), 6000)]);
assert_eq!(stripe_orders(&app.pool, "anna@example.com").await, vec![("couple".to_string(), 5000)]);
// What the invoice needs is kept, and the invoice is queued.
let (intent, amount, customer, terms): (String, i32, Value, Option<String>) = sqlx::query_as(
"SELECT payment_intent, amount_huf, customer, terms_version FROM stripe_checkouts \
@@ -2809,7 +2809,7 @@ async fn stripe_checkout_grants_the_paid_package_once(pool: PgPool) {
assert_eq!(r.body["status"], "paid");
assert_eq!(
stripe_orders(&app.pool, "anna@example.com").await,
vec![("couple".to_string(), 6000), ("single".to_string(), 2000)]
vec![("couple".to_string(), 5000), ("single".to_string(), 2000)]
);
let (name, tax_type): (String, String) =
sqlx::query_as("SELECT buyer_name, buyer_tax_type FROM invoices WHERE checkout_id = $1")