Weekly horoscope: its own page, a Monday e-mail, and one page for every e-mail setting
CI / test (push) Successful in 3m17s
CI / build (push) Skipped
CI / deploy (push) Skipped

- The week's sky on the member's own chart (horoscope-api POST /v1/week,
  astro_engine::week): the planets' aspects to the natal points with the day
  each is exact, positions, the Moon's signs, lunar phases, stations and sign
  changes; stored once per chart and week (weekly_skies, migration 0047).
- Its text is a 'weekly' analysis written by the summary's (cheap) model when
  the member opens /heti-horoszkop: one month per page, the newest week
  first, the waiting animation while it is written. In the menu, and linked
  from the chart page.
- Monday 7:00 e-mail (worker task 'weekly'): only that it is there; on by
  default for everyone with a chart, members of today too. Its footer opens
  /ertesitesek?token=…, where the weekly e-mail and every forum e-mail can
  be set without logging in; the mail client's one-click unsubscribe turns
  off the weekly one. Also a switch on the page and on the Profile page.
- Privacy notice (HU/EN) describes it; ratings, admin labels and the model
  page know the new 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-27 09:40:09 +00:00
co-authored by Claude Opus 5.5
parent 50c29e4595
commit 0358e137f1
46 changed files with 2368 additions and 70 deletions
@@ -217,3 +217,37 @@ fn solar_return_and_forecast() {
assert!(f.eclipses.iter().any(|e| e.date == "2026-08-28"));
serde_json::to_string(&f).unwrap();
}
#[test]
fn one_week() {
use astro_engine::calculate_week;
let input = ChartInput { jd_ut: JD, observer: BUDAPEST, time_known: true, options: ChartOptions::default() };
let natal = calculate_chart(engine(), &input).unwrap();
// Monday 30 November 2026, 0:00 in Budapest (UTC+1), to the next Monday.
let start = 2_461_374.5 - 1.0 / 24.0;
assert_eq!(astro_engine::forecast::date_of(start, 1.0), "2026-11-30");
let w = calculate_week(engine(), &natal, start, start + 7.0, 1.0).unwrap();
assert_eq!((w.start.as_str(), w.end.as_str()), ("2026-11-30", "2026-12-06"));
assert_eq!(w.positions.len(), 9);
assert!(w.positions.iter().all(|p| p.house.is_some()));
// Every contact is within orb during the week, with its peak and exact hits inside it.
assert!(!w.contacts.is_empty());
for c in &w.contacts {
assert!(c.min_orb <= 1.0, "{c:?}");
assert!(c.peak.as_str() >= w.start.as_str() && c.peak.as_str() <= w.end.as_str(), "{c:?}");
assert!(c.exact.iter().all(|e| e.date >= w.start && e.date <= w.end), "{c:?}");
assert_ne!(c.planet, astro_engine::chart::PointId::Moon);
}
// The Moon changes sign every two or three days, each time into the next sign.
assert!((2..=4).contains(&w.moon_ingresses.len()), "{:?}", w.moon_ingresses);
let mut sign = w.moon_sign;
for i in &w.moon_ingresses {
assert_eq!(i.sign.index(), (sign.index() + 1) % 12);
sign = i.sign;
}
// About one main lunar phase a week.
assert!((1..=2).contains(&w.lunations.len()), "{:?}", w.lunations);
let json = serde_json::to_value(&w).unwrap();
assert!(json["contacts"][0]["planet"].is_string());
assert!(json["positions"][0]["sign"].is_string());
}