Fix Garmin intensity minutes and add user-configurable phase goals
All checks were successful
Deploy / deploy (push) Successful in 2m38s

- Apply 2x multiplier for vigorous intensity minutes (matches Garmin)
- Use calendar week (Mon-Sun) instead of trailing 7 days for intensity
- Add HRV yesterday fallback when today's data returns empty
- Add user-configurable phase intensity goals with new defaults:
  - Menstrual: 75, Follicular: 150, Ovulation: 100
  - Early Luteal: 120, Late Luteal: 50
- Update garmin-sync and today routes to use user-specific phase limits

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-16 20:18:20 +00:00
parent a1495ff23f
commit 6cd0c06396
24 changed files with 423 additions and 66 deletions

View File

@@ -157,10 +157,11 @@ describe("getPhase", () => {
describe("getPhaseLimit", () => {
it("returns correct weekly limits for each phase", () => {
expect(getPhaseLimit("MENSTRUAL")).toBe(30);
expect(getPhaseLimit("FOLLICULAR")).toBe(120);
expect(getPhaseLimit("OVULATION")).toBe(80);
expect(getPhaseLimit("EARLY_LUTEAL")).toBe(100);
// Default intensity goals (can be overridden per user)
expect(getPhaseLimit("MENSTRUAL")).toBe(75);
expect(getPhaseLimit("FOLLICULAR")).toBe(150);
expect(getPhaseLimit("OVULATION")).toBe(100);
expect(getPhaseLimit("EARLY_LUTEAL")).toBe(120);
expect(getPhaseLimit("LATE_LUTEAL")).toBe(50);
});
});