/**
 * CLI wrapper for seeding the Payload CMS database.
 * Usage: pnpm tsx scripts/seed-payload.ts
 */
import { getPayload } from 'payload';
import configPromise from '../payload.config';
import { seedDatabase } from '../src/payload/seed';

async function run() {
  const payload = await getPayload({ config: configPromise });

  console.log('🌱 Starting database seed...');
  await seedDatabase(payload);
  console.log('✅ Seeding complete.');

  process.exit(0);
}

run().catch((err) => {
  console.error('❌ Seeding failed:', err);
  process.exit(1);
});
