Yearly forecast: solar return, transits, progressions, profection, eclipses
- astro-engine: forecast module (solar return moment, slow-planet transits
with exact dates and periods, natal house ingresses, secondary
progressions, annual profection, eclipses via Swiss Ephemeris)
- horoscope-api: POST /v1/forecast, solar return chart cast for the place
of the birthday
- backend: forecasts table, /v1/charts/{id}/forecasts, /v1/forecasts/{id}
and its analyses using a new 'forecast' unit; current year of life open,
the next one 30 days before the birthday
- packages: Páros and Család include forecasts (6 000 / 11 000 Ft),
+1 éves előrejelzés add-on 2 500 Ft; Egy elemzés unchanged
- worker and prompt: forecast kind with five sections and forecast rules
(trends, no event predictions); no birth data, place or exact age sent
- frontend: /kepletek/{id}/elorejelzes with the solar return wheel, the
keys of the year, a monthly timeline, transit list and detailed forecast
- data export: forecasts added, model name removed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -273,3 +273,48 @@ async fn synastry_unknown_time_and_errors() {
|
||||
let (status, _) = call("POST", "/v1/synastry", Some(json!({"person1": {"date": "1985-07-14"}}))).await;
|
||||
assert_eq!(status, StatusCode::BAD_REQUEST);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn forecast_year_with_solar_return() {
|
||||
let birth = json!({"date": "1985-07-14", "time": "14:30", "country": "HU", "place": "Budapest"});
|
||||
let (status, d) = call("POST", "/v1/forecast", Some(json!({"birth": birth, "year": 2026}))).await;
|
||||
assert_eq!(status, StatusCode::OK, "{d}");
|
||||
let sr = &d["solar_return"];
|
||||
assert_eq!(sr["timezone"], "Europe/Budapest");
|
||||
assert!(sr["local_time"].as_str().unwrap().starts_with("2026-07-14T"), "{sr}");
|
||||
assert_eq!(sr["utc_offset"], "+02:00");
|
||||
assert_eq!(sr["points"][0]["sign"], "cancer");
|
||||
assert!(sr["natal_house_of_ascendant"].as_u64().is_some());
|
||||
assert_eq!(sr["location"]["place"]["name"], "Budapest");
|
||||
let f = &d["forecast"];
|
||||
assert_eq!(f["start"], "2026-07-14");
|
||||
assert_eq!(f["age"], 41);
|
||||
assert_eq!(f["profection"]["lord"], "mars");
|
||||
assert!(!f["transits"].as_array().unwrap().is_empty());
|
||||
|
||||
// Elsewhere on the birthday: same moment, other houses.
|
||||
let (status, e) = call(
|
||||
"POST",
|
||||
"/v1/forecast",
|
||||
Some(json!({"birth": birth, "year": 2026, "location": {"country": "JP", "place": "Tokyo"}})),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(status, StatusCode::OK, "{e}");
|
||||
assert_eq!(e["solar_return"]["moment_utc"], sr["moment_utc"]);
|
||||
assert_eq!(e["solar_return"]["timezone"], "Asia/Tokyo");
|
||||
assert_ne!(e["solar_return"]["angles"]["ascendant"]["sign"], sr["angles"]["ascendant"]["sign"]);
|
||||
|
||||
// Unknown birth time: no solar return chart, the rest is there.
|
||||
let (status, u) = call(
|
||||
"POST",
|
||||
"/v1/forecast",
|
||||
Some(json!({"birth": {"date": "1985-07-14", "country": "HU", "place": "Budapest"}, "year": 2026})),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(status, StatusCode::OK, "{u}");
|
||||
assert!(u["solar_return"].is_null());
|
||||
assert!(u["forecast"]["profection"].is_null());
|
||||
|
||||
let (status, _) = call("POST", "/v1/forecast", Some(json!({"birth": birth, "year": 1985}))).await;
|
||||
assert_eq!(status, StatusCode::BAD_REQUEST);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user