- Remove OtpGateGuard from transactions controller (OTP verified at login) - Fix categories controller to use authenticated user instead of TEMP_USER_ID - Add comprehensive implementation plan document - Update .env.example with WEB_APP_URL - Prepare for admin dashboard development
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const client_1 = require("@prisma/client");
|
|
const prisma = new client_1.PrismaClient();
|
|
const adminSeeder = {
|
|
email: 'dwindi.ramadhana@gmail.com',
|
|
password: 'tabungin2k25!@#',
|
|
};
|
|
const TEMP_USER_ID = process.env.TEMP_USER_ID || '16b74848-daa3-4dc9-8de2-3cf59e08f8e3';
|
|
async function main() {
|
|
const user = await prisma.user.upsert({
|
|
where: { id: TEMP_USER_ID },
|
|
update: {},
|
|
create: {
|
|
id: TEMP_USER_ID,
|
|
email: 'temp@example.com',
|
|
},
|
|
});
|
|
const existing = await prisma.wallet.findFirst({});
|
|
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
|