navidocs/server/db/seed-test-data.js
Danny Stocker 58b344aa31 FINAL: P0 blockers fixed + Joe Trader + ignore binaries
Fixed:
- Price: €800K-€1.5M, Sunseeker added
- Agent 1: Joe Trader persona + actual sale ads research
- Ignored meilisearch binary + data/ (too large for GitHub)
- SESSION_DEBUG_BLOCKERS.md created

Ready for Session 1 launch.

🤖 Generated with Claude Code
2025-11-13 01:29:59 +01:00

46 lines
1.3 KiB
JavaScript

/**
* Seed test data for development
*/
import { getDb } from './db.js';
const db = getDb();
// Create test user
const testUserId = 'test-user-id';
const testOrgId = 'test-org-id';
try {
// Check if test user exists
const existingUser = db.prepare('SELECT id FROM users WHERE id = ?').get(testUserId);
if (!existingUser) {
console.log('Creating test user...');
db.prepare(`
INSERT INTO users (id, email, name, created_at)
VALUES (?, ?, ?, ?)
`).run(testUserId, 'test@navidocs.local', 'Test User', Date.now());
console.log('✓ Test user created');
} else {
console.log('✓ Test user already exists');
}
// Check if test organization exists
const existingOrg = db.prepare('SELECT id FROM organizations WHERE id = ?').get(testOrgId);
if (!existingOrg) {
console.log('Creating test organization...');
db.prepare(`
INSERT INTO organizations (id, name, created_at)
VALUES (?, ?, ?)
`).run(testOrgId, 'Test Organization', Date.now());
console.log('✓ Test organization created');
} else {
console.log('✓ Test organization already exists');
}
console.log('\n✅ Test data seeded successfully');
process.exit(0);
} catch (error) {
console.error('❌ Error seeding test data:', error);
process.exit(1);
}