mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-02-22 16:42:00 +00:00
- Replaced 'house_name' with 'address' in user schema and related files. - Added new fields for terms and privacy policy acceptance in the signup form schema. - Updated package.json and package-lock.json to include @radix-ui/react-checkbox for checkbox functionality. - Modified seed script to reflect changes in the user model.
37 lines
897 B
TypeScript
37 lines
897 B
TypeScript
import { faker } from "@faker-js/faker";
|
|
import { PrismaClient } from "@prisma/client";
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
const users = Array.from({ length: 25 }, () => ({
|
|
name: `${faker.person.fullName().split(" ")[1]} House-${crypto
|
|
.randomUUID()
|
|
.slice(0, 5)}`,
|
|
email: faker.internet.email(),
|
|
emailVerified: false,
|
|
firstPaymentDone: false,
|
|
verified: false,
|
|
address: faker.location.streetAddress(),
|
|
id_card: `A${Math.round(Math.random() * 999999)}`,
|
|
dob: faker.date.between({
|
|
from: "1900-01-01",
|
|
to: "2000-01-01",
|
|
}),
|
|
phoneNumber: String(faker.number.int({ min: 7000000, max: 9999999 })),
|
|
phoneNumberVerified: false,
|
|
role: "USER",
|
|
}));
|
|
await prisma.user.createMany({
|
|
data: users,
|
|
});
|
|
}
|
|
|
|
main()
|
|
.then(() => prisma.$disconnect())
|
|
.catch(async (e) => {
|
|
console.error(e);
|
|
await prisma.$disconnect();
|
|
process.exit(1);
|
|
});
|