Chart page with a drawn wheel; reuse saved charts for identical birth data
- New /kepletek/[id] page: chart wheel (SVG), big three, elements, modalities, moon phase, positions and an aspects table. /keplet opens the user's own chart; the home page goes there after login. - The profile only shows the birth data, with a link to the chart. - Saving the same birth data again returns the stored chart (200) instead of calculating a new one. - Charts without a birth time (angles null) render without houses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -358,6 +358,25 @@ async fn charts_are_private(pool: PgPool) {
|
||||
assert_eq!(list["charts"][0]["id"], other["id"]); // the new primary first
|
||||
assert_eq!(list["charts"][1]["is_primary"], false);
|
||||
|
||||
// the same birth data again: the saved chart is reused, not calculated again
|
||||
let r = app
|
||||
.post(
|
||||
"/v1/charts",
|
||||
Some(&anna),
|
||||
json!({"label": "Újra", "is_primary": true,
|
||||
"birth": {"date": "1990-03-15", "time": "14:30", "country": "HU", "place": "Szeged"}}),
|
||||
)
|
||||
.await;
|
||||
assert_eq!((r.status, r.body["id"].as_str(), &r.body["is_primary"]), (StatusCode::OK, Some(id), &json!(true)));
|
||||
assert_eq!(app.get("/v1/charts", Some(&anna)).await.body["charts"].as_array().unwrap().len(), 2);
|
||||
app.call(
|
||||
"PATCH",
|
||||
&format!("/v1/charts/{}", other["id"].as_str().unwrap()),
|
||||
Some(&anna),
|
||||
Some(json!({"is_primary": true})),
|
||||
)
|
||||
.await;
|
||||
|
||||
assert_eq!(app.get(&format!("/v1/charts/{id}"), Some(&bela)).await.status, StatusCode::NOT_FOUND);
|
||||
assert_eq!(app.call("DELETE", &format!("/v1/charts/{id}"), Some(&bela), None).await.status, StatusCode::NOT_FOUND);
|
||||
assert_eq!(app.get("/v1/charts/not-a-uuid", Some(&anna)).await.status, StatusCode::BAD_REQUEST);
|
||||
|
||||
Reference in New Issue
Block a user