first commit

This commit is contained in:
dwindown
2025-10-09 12:52:41 +07:00
commit 0da6071eb3
205 changed files with 30980 additions and 0 deletions

37
apps/api/dist/seed.js vendored Normal file
View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const client_1 = require("@prisma/client");
const prisma = new client_1.PrismaClient();
async function main() {
const userId = '16b74848-daa3-4dc9-8de2-3cf59e08f8e3';
const user = await prisma.user.upsert({
where: { id: userId },
update: {},
create: {
id: userId,
},
});
const existing = await prisma.wallet.findFirst({
where: { userId: user.id, kind: 'money' },
});
if (!existing) {
await prisma.wallet.create({
data: {
userId: user.id,
kind: 'money',
name: 'Cash',
currency: 'IDR',
},
});
}
console.log('Seed complete. TEMP_USER_ID=', user.id);
}
main()
.catch((e) => {
console.error(e);
process.exit(1);
})
.finally(async () => {
await prisma.$disconnect();
});
//# sourceMappingURL=seed.js.map