#!/usr/bin/env node
/**
 * Vérifier les propriétés des notes
 */

import { PrismaClient } from '../keep-notes/prisma/client-generated/index.js';

const prisma = new PrismaClient({
  datasources: {
    db: { url: 'file:/Users/sepehr/dev/Keep/keep-notes/prisma/dev.db' },
  },
});

async function checkNotes() {
  const notes = await prisma.note.findMany({
    where: {
      title: { startsWith: '📘' },
    },
    select: {
      id: true,
      title: true,
      isMarkdown: true,
      type: true,
      color: true,
      labels: true,
    },
  });

  console.log('📋 Notes trouvées:\n');
  for (const note of notes) {
    console.log(`Titre: ${note.title}`);
    console.log(`  isMarkdown: ${note.isMarkdown}`);
    console.log(`  type: ${note.type}`);
    console.log(`  color: ${note.color}`);
    console.log(`  labels: ${note.labels}`);
    console.log(`  id: ${note.id}`);
    console.log('');
  }
}

checkNotes()
  .catch(console.error)
  .finally(() => prisma.$disconnect());
