#!/usr/bin/env node
/**
* Complete onboarding by setting all step flags to true
* This allows direct access to the dashboard without going through onboarding screens
*/
import pg from 'pg';
const { Client } = pg;
const client = new Client({
host: 'localhost',
port: 5433,
database: 'pg-litefarm',
user: 'postgres',
password: 'postgres'
});
const USER_ID = '3f930e96-4782-4e53-ac9a-3e855f2e7a54';
const FARM_ID = 'a33d03fc-9149-4568-a9d4-196549e61667';
async function completeOnboarding() {
try {
await client.connect();
console.log(' Mit Datenbank verbunden\n');
// Zeige aktuellen Status
console.log('=� Status VORHER:');
const before = await client.query(
`SELECT step_one, step_two, step_three, step_four, step_five, has_consent
FROM "userFarm"
WHERE user_id = $1 AND farm_id = $2`,
[USER_ID, FARM_ID]
);
console.log(before.rows[0]);
console.log('');
// Update: Setze alle Steps auf true
console.log('= Setze alle Onboarding-Steps auf TRUE...\n');
await client.query(
`UPDATE "userFarm"
SET
step_one = true,
step_two = true,
step_three = true,
step_four = true,
step_five = true,
has_consent = true
WHERE user_id = $1 AND farm_id = $2`,
[USER_ID, FARM_ID]
);
// Zeige neuen Status
console.log('=� Status NACHHER:');
const after = await client.query(
`SELECT step_one, step_two, step_three, step_four, step_five, has_consent
FROM "userFarm"
WHERE user_id = $1 AND farm_id = $2`,
[USER_ID, FARM_ID]
);
console.log(after.rows[0]);
console.log('');
console.log(' Onboarding abgeschlossen!');
console.log('');
console.log('<� Du kannst jetzt direkt auf das Dashboard zugreifen:');
console.log(' http://localhost:3001');
console.log('');
console.log('=� Was passiert jetzt:');
console.log(' - Beim Login wirst du direkt zum Dashboard weitergeleitet');
console.log(' - Keine Onboarding-Screens mehr');
console.log(' - MCP Server funktioniert weiterhin perfekt');
console.log('');
console.log('� Falls du das r�ckg�ngig machen willst:');
console.log(' node revert-onboarding.js');
} catch (error) {
console.error('L Fehler:', error.message);
process.exit(1);
} finally {
await client.end();
}
}
completeOnboarding();