Pay months on Charts, left this month, check-ins and onboarding
With months that start on payday, Charts groups by pay month (presets, savings rate and month to date included, day 1 being payday). Left this month counts bills and the usual pace up to the day before the next salary. Check-ins read this month, budget tips and the weekly cap from the pay month, and onboarding looks at full pay months. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d42d52e4d
commit
943b19d743
10 files changed
+112
-55
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { mkdirSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { changeLines, checkinFacts, sameDollars, type CheckinFacts } from "@/lib/checkins";
|
||||
import { allRows, today as todayDate, displayName, isSpend, TXN_SELECT, typicalMonthly, type Txn } from "@/lib/data";
|
||||
import { allRows, today as todayDate, displayName, isSpend, paySpan, TXN_SELECT, typicalMonthly, type Txn } from "@/lib/data";
|
||||
import { runViaHelper } from "@/lib/llm/helper";
|
||||
import { runCodex, runGemini, runOpencode } from "@/lib/llm/cli-snapshot";
|
||||
import { AGENT_DIR, runClaudeCode } from "@/lib/llm/claude-code";
|
||||
@@ -83,6 +83,7 @@ async function generate(supabase: Sb, user: User, replace: string | null) {
|
||||
supabase.from("checkins").select("facts").eq("user_id", userId).lt("created_at", new Date(Date.now() - SINCE).toISOString()).order("created_at", { ascending: false }).limit(1).maybeSingle(),
|
||||
loadPlan(supabase, userId).catch(() => null),
|
||||
]);
|
||||
const span = await paySpan(supabase, userId, today); // months that start on payday, if on
|
||||
// The plan's next move by the ladder, or one marked done in the last 7 days.
|
||||
type M = { title: string; why: string; status?: string; done_at?: string | null; deadline: string | null; ref: string | null; kind: Kind; step: number | null };
|
||||
const moves = (plan?.moves ?? []) as unknown as M[];
|
||||
@@ -108,6 +109,7 @@ async function generate(supabase: Sb, user: User, replace: string | null) {
|
||||
prev: (prev?.facts as CheckinFacts | undefined) ?? null,
|
||||
move: pick ? { title: pick.title, line: whyLine(pick.title, pick.why), done: pick === justDone, by: pick.deadline ?? addDays(today, 7) } : null,
|
||||
today,
|
||||
span,
|
||||
});
|
||||
|
||||
// Off: no model call, the card shows the plain facts. Summary: placeholders and rounded amounts, names swapped back below.
|
||||
|
||||
Reference in new issue
Block a user