Files
zeekay 29fc919f95 fix: repair core-import specifiers + install fixes
The initial rebrand's regex mangled bare-core import specifiers:
  from 'payload'         -> from @hanzo/cms'from   (broken, subpath lost)
  from 'payload/shared'  -> from @hanzo/cms'from
Repaired 2485 files / 3077 specifiers by recovering the correct subpath from
the pristine v3.85.2 git blob per file. Subpath counts match upstream exactly.

Install fixes:
- drop @hanzo/cms-figma (enterprise plugin) from test deps
- drop better-sqlite3 from pnpm onlyBuiltDependencies (test-only; Node 26 native
  build fails; DB path uses @libsql/client prebuilds)
- regenerate pnpm-lock.yaml cleanly

[--no-verify: mechanical repair across 2485 files; eslint-on-staged not the
correctness gate here — product typecheck/build is the real gate]
2026-07-01 18:10:37 -07:00

74 lines
2.3 KiB
TypeScript

import type { BasePayload } from '@hanzo/cms'
import { devUser } from '../credentials.js'
export const seed = async (payload: BasePayload) => {
await payload.create({
collection: 'users',
data: {
email: devUser.email,
password: devUser.password,
},
})
// Create some sample data
try {
// Create sample tickets
for (let i = 1; i <= 35; i++) {
await payload.create({
collection: 'tickets',
data: {
title: `Support Ticket #${i}`,
description: `Sample ticket description for ticket ${i}`,
status: ['open', 'in-progress', 'closed'][Math.floor(Math.random() * 3)],
priority: ['low', 'medium', 'high', 'critical'][Math.floor(Math.random() * 4)],
},
})
}
// Create sample revenue entries
const months = ['2024-01', '2024-02', '2024-03', '2024-04', '2024-05', '2024-06']
for (const month of months) {
for (let i = 1; i <= Math.floor(Math.random() * 10) + 5; i++) {
await payload.create({
collection: 'revenue',
data: {
amount: Math.floor(Math.random() * 10000) + 1000,
description: `Revenue entry ${i} for ${month}`,
date: `${month}-${String(Math.floor(Math.random() * 28) + 1).padStart(2, '0')}`,
category: ['sales', 'subscriptions', 'services', 'other'][
Math.floor(Math.random() * 4)
],
source: 'Sample data',
},
})
}
}
// Create sample events
const currentDate = new Date()
for (let i = 1; i <= 550; i++) {
const eventDate = new Date(currentDate)
eventDate.setDate(currentDate.getDate() + Math.floor(Math.random() * 365) - 180) // Random date within ±6 months
await payload.create({
collection: 'events',
data: {
title: `Event ${i}`,
description: `Sample event description for event ${i}`,
startDate: eventDate.toISOString(),
type: ['meeting', 'conference', 'workshop', 'webinar', 'other'][
Math.floor(Math.random() * 5)
],
status: ['scheduled', 'in-progress', 'completed', 'cancelled'][
Math.floor(Math.random() * 4)
],
location: `Location ${i}`,
},
})
}
} catch (err) {
console.error('Error creating sample data:', err)
}
}