add more data

This commit is contained in:
Nông Đức Huy
2026-08-13 23:20:23 +07:00
parent 8fd23d162f
commit 57f44796ce
20 changed files with 1436 additions and 18 deletions
+13
View File
@@ -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) {