/**
 * One-time script: add /email to user 2's dock
 *
 * Usage: bun run scripts/add-email-dock-user2.ts
 */

import { getDockPaths, setDockPaths } from 'officerdb';

const USER_ID = 2;
const DEFAULT_PATHS = ['/', '/files', '/automation', '/projects', '/dashboards', '/chat'];

async function main() {
  const existing = await getDockPaths(USER_ID);
  const paths = existing ?? DEFAULT_PATHS;

  if (paths.includes('/email')) {
    console.log(`[dock] User ${USER_ID} already has /email in dock`);
  } else {
    paths.push('/email');
    await setDockPaths(USER_ID, paths);
    console.log(`[dock] Added /email to user ${USER_ID}'s dock: ${JSON.stringify(paths)}`);
  }

  process.exit(0);
}

main().catch((err) => {
  console.error('[dock] Failed:', err);
  process.exit(1);
});
