From 3325fc5deda53a8a0b66365ce85f8bb93ada0ef3 Mon Sep 17 00:00:00 2001 From: Mohammad Bagher Ehtemam Date: Mon, 20 Jan 2025 21:07:19 +0100 Subject: [PATCH] fix userId and stripeInvoice id issue --- prisma/seed.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prisma/seed.ts b/prisma/seed.ts index cef9343..aafad5b 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -2,13 +2,14 @@ import { PrismaClient } from '@prisma/client'; import { faker } from '@faker-js/faker'; const db = new PrismaClient(); +const userId = faker.number.int({ min: 5, max: 10 }); const main = async () => { const orderData = [...Array(10)].map(() => ({ id: faker.number.int({ min: 10, max: 170 }), total: faker.number.float({ min: 7, max: 15657, precision: 0.01 }), createdAt: faker.date.anytime(), updatedAt: faker.date.anytime(), - userId: 5, + userId: userId, stripeInvoiceId: faker.string.alphanumeric(15), })); @@ -22,7 +23,7 @@ const main = async () => { await db.user.create({ data: { - id: faker.number.int({ min: 5, max: 10 }), + id: userId, name: faker.person.fullName(), address: faker.location.streetAddress(), email: faker.internet.email(), @@ -50,6 +51,7 @@ const main = async () => { createdAt: order.createdAt, updatedAt: order.updatedAt, userId: order.userId, + stripeInvoiceId: order.stripeInvoiceId }, }); });