Tarot readings have a topic: general, relationship, work, self-knowledge
CI / test (push) Successful in 1m27s
CI / build (push) Successful in 5m37s
CI / deploy (push) Skipped

The new reading form starts with the topic; it steers how the model
reads the cards (with the topic's own limits, e.g. no break-up
predictions for relationships) and shows on the reading and in the
list. Readings from before count as general.

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 16:25:12 +00:00
co-authored by Claude Opus 5.5
parent b0e1270246
commit 7f6f05150e
8 changed files with 149 additions and 10 deletions
+4 -1
View File
@@ -2593,7 +2593,7 @@ async fn tarot_readings_draw_on_the_server_and_use_tarot_units(pool: PgPool) {
let app = TestApp::new(pool.clone()).await;
let anna = app.register("anna@example.com", "Anna").await;
app.chart(&anna, "Saját", true, "1990-07-01").await;
let body = json!({"spread": "trinity", "question": "Merre induljak tovább?"});
let body = json!({"spread": "trinity", "topic": "love", "question": "Merre induljak tovább?"});
// No units: a package or the addon is needed.
let r = app.post("/v1/tarot/readings", Some(&anna), body.clone()).await;
assert_eq!(r.status, StatusCode::PAYMENT_REQUIRED, "{}", r.body);
@@ -2610,6 +2610,8 @@ async fn tarot_readings_draw_on_the_server_and_use_tarot_units(pool: PgPool) {
let r = app.post("/v1/tarot/readings", Some(&anna), json!({"spread": "nincs"})).await;
assert_eq!(r.status, StatusCode::BAD_REQUEST);
let r = app.post("/v1/tarot/readings", Some(&anna), json!({"spread": "daily", "topic": "pénz"})).await;
assert_eq!(r.status, StatusCode::BAD_REQUEST);
let long = "x".repeat(analysis_prompt::TAROT_QUESTION_MAX_CHARS + 1);
let r = app.post("/v1/tarot/readings", Some(&anna), json!({"spread": "daily", "question": long})).await;
assert_eq!(r.status, StatusCode::BAD_REQUEST);
@@ -2618,6 +2620,7 @@ async fn tarot_readings_draw_on_the_server_and_use_tarot_units(pool: PgPool) {
assert_eq!(r.status, StatusCode::ACCEPTED, "{}", r.body);
assert_eq!(r.body["status"], "pending");
assert_eq!(r.body["spread_name"], "Sorsfonalak hármas");
assert_eq!((&r.body["topic"], &r.body["topic_name"]), (&json!("love"), &json!("Párkapcsolat")));
assert_eq!(r.body["question"], "Merre induljak tovább?");
let cards = r.body["cards"].as_array().unwrap();
assert_eq!(cards.len(), 3);