Questions about relationship analyses too
CI / test (push) Successful in 1m6s
CI / build (push) Successful in 5m1s
CI / deploy (push) Skipped

- The answer sees both charts and the comparison; both people see the questions
- Heading, hint and example question per analysis kind

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-18 21:51:38 +00:00
co-authored by Claude Opus 5.5
parent 02e4e225f0
commit 029a001ca6
11 changed files with 116 additions and 29 deletions
+5 -4
View File
@@ -1,5 +1,6 @@
//! Questions about a finished detailed analysis: a natal chart analysis or a
//! yearly forecast. Each question uses a `question` unit (admins ask for
//! Questions about a finished detailed analysis: a natal chart analysis, a
//! relationship (synastry) analysis or a yearly forecast. On a comparison both
//! people see the questions and answers. Each question uses a `question` unit (admins ask for
//! free). The worker answers with the question model of the admin page,
//! seeing the chart data, the analysis and the earlier questions about it.
@@ -23,7 +24,7 @@ use crate::error::{ApiError, ApiResult};
use crate::views::{rfc3339, rfc3339_opt};
/// The analyses that can be asked about.
const ASKABLE: [&str; 2] = ["natal", "forecast"];
const ASKABLE: [&str; 3] = ["natal", "synastry", "forecast"];
/// A safety cap per analysis.
const MAX_PER_ANALYSIS: i64 = 100;
@@ -115,7 +116,7 @@ pub async fn ask(
return Err(ApiError::NotFound("analysis"));
}
if !ASKABLE.contains(&analysis.kind.as_str()) {
return Err(ApiError::BadRequest("questions can be asked about a natal analysis or a forecast".into()));
return Err(ApiError::BadRequest("questions can be asked about a detailed analysis or a forecast".into()));
}
if analysis.status != "done" {
return Err(ApiError::conflict("analysis_not_ready", "Az elemzés még nem készült el."));