test run for user rebalance expenses feature, added safeguard for estimate exepenses acceptance in onboarding
All checks were successful
Deploy / deploy (push) Successful in 1m28s
Security Tests / security-non-db (push) Successful in 19s
Security Tests / security-db (push) Successful in 24s

This commit is contained in:
2026-03-11 21:17:45 -05:00
parent cccce2c854
commit 3199e676a8
12 changed files with 583 additions and 18 deletions

View File

@@ -11,8 +11,6 @@ export type NewPlan = {
name: string;
totalCents: number; // >= 0
fundedCents?: number; // optional, default 0
amountMode?: "fixed" | "estimated";
estimatedCents?: number | null;
priority: number; // int
dueOn: string; // ISO date
frequency?: "one-time" | "weekly" | "biweekly" | "monthly";

26
web/src/api/rebalance.ts Normal file
View File

@@ -0,0 +1,26 @@
import { apiGet, apiPost } from "./http";
export type RebalanceCategory = {
id: string;
name: string;
percent: number;
isSavings: boolean;
balanceCents: number;
};
export type RebalanceInfo = {
ok: boolean;
availableCents: number;
categories: RebalanceCategory[];
};
export type ManualRebalanceBody = {
targets: Array<{ id: string; targetCents: number }>;
forceLowerSavings?: boolean;
};
export const rebalanceApi = {
fetchInfo: () => apiGet<RebalanceInfo>("/variable-categories/manual-rebalance"),
submit: (body: ManualRebalanceBody) =>
apiPost<RebalanceInfo>("/variable-categories/manual-rebalance", body),
};