add more data
This commit is contained in:
@@ -11,6 +11,7 @@ import { ALL_PERMISSIONS, PERMISSIONS, SYSTEM_ROLES, type Permission } from '@sp
|
||||
|
||||
import { seedDevAccounts } from './seed/accounts';
|
||||
import { seedCatalog } from './seed/catalog';
|
||||
import { seedDemoVolume } from './seed/demo';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
@@ -147,6 +148,18 @@ async function main(): Promise<void> {
|
||||
await seedCatalog(prisma);
|
||||
|
||||
const accounts = await seedDevAccounts(prisma);
|
||||
|
||||
/**
|
||||
* Demo volume — orders, customers, reviews, posts.
|
||||
*
|
||||
* Behind the same guard as the demo catalog: production seeds roles,
|
||||
* permissions and an inventory location, and nothing else.
|
||||
*/
|
||||
const demo = await seedDemoVolume(prisma);
|
||||
console.log(
|
||||
`Demo volume: ${demo.customers} customers, ${demo.orders} orders, ` +
|
||||
`${demo.reviews} reviews, ${demo.content} posts, ${demo.discounts} discounts.`,
|
||||
);
|
||||
const created = accounts.filter((account) => account.created);
|
||||
|
||||
if (created.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user