final touches for beta skymoney (at least i think)

This commit is contained in:
2026-01-18 00:00:44 -06:00
parent 4eae966f96
commit f4f0ae5df2
161 changed files with 26016 additions and 1966 deletions

View File

@@ -11,22 +11,39 @@ async function main() {
// 1) User
await prisma.user.upsert({
where: { id: userId },
create: { id: userId, email: "demo@example.com" },
update: {},
create: {
id: userId,
email: "demo@example.com",
incomeFrequency: "biweekly"
},
update: { incomeFrequency: "biweekly" },
});
// 2) Variable categories (sum = 100)
const categories = [
{ name: "Savings", percent: 40, isSavings: true, priority: 10 },
{ name: "Needs", percent: 40, isSavings: false, priority: 20 },
{ name: "Wants", percent: 20, isSavings: false, priority: 30 },
{ name: "Savings", percent: 40, isSavings: true, priority: 10, target: cents(5000) },
{ name: "Needs", percent: 40, isSavings: false, priority: 20 },
{ name: "Wants", percent: 20, isSavings: false, priority: 30 },
];
for (const c of categories) {
await prisma.variableCategory.upsert({
where: { userId_name: { userId, name: c.name } },
create: { userId, name: c.name, percent: c.percent, isSavings: c.isSavings, priority: c.priority, balanceCents: 0n },
update: { percent: c.percent, isSavings: c.isSavings, priority: c.priority },
create: {
userId,
name: c.name,
percent: c.percent,
isSavings: c.isSavings,
priority: c.priority,
balanceCents: 0n,
savingsTargetCents: c.target ?? null,
},
update: {
percent: c.percent,
isSavings: c.isSavings,
priority: c.priority,
savingsTargetCents: c.target ?? null,
},
});
}
@@ -82,4 +99,4 @@ main().catch((e) => {
process.exit(1);
}).finally(async () => {
await prisma.$disconnect();
});
});