import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

async function main() {
  console.log('🧹 Entferne LexOffice-Artikel-IDs...');

  const result = await prisma.priceConfig.updateMany({
    data: {
      lexofficeArticleId: null,
      lexofficeArticleIdWithFlat: null,
      lexofficeKmFlatArticleId: null,
      lexofficeKmExtraArticleId: null,
    },
  });

  console.log(`✅ ${result.count} PriceConfigs aktualisiert`);

  const configs = await prisma.priceConfig.findMany({
    select: {
      id: true,
      model: true,
      basePrice: true,
      lexofficeArticleId: true,
      lexofficeArticleIdWithFlat: true,
    },
  });

  console.log('\n📊 Aktuelle PriceConfigs:');
  console.table(configs);
}

main()
  .catch((e) => {
    console.error(e);
    process.exit(1);
  })
  .finally(async () => {
    await prisma.$disconnect();
  });
