edtech / apps /api /scratch /connect_testcrm.ts
CognxSafeTrack
feat(admin): add Direct Setup button for super admins on orgs without phone number
a3df350
import 'dotenv/config';
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const TESTCRM_ORG_ID = 'ba012b65-2289-4ded-956d-aeaaf908fb30';
const PHONE_NUMBER_ID = '1135406776315489';
const DISPLAY_PHONE = '+221 78 822 76 76';
const WABA_ID = '1503271284790621';
// 1. Retirer le numéro de default-org-id (où on l'avait mis par erreur)
await prisma.whatsAppPhoneNumber.update({
where: { id: PHONE_NUMBER_ID },
data: { organizationId: TESTCRM_ORG_ID }
});
console.log(`✅ Numéro transféré vers testcrm : ${DISPLAY_PHONE}`);
// 2. Mettre à jour le WABA ID sur testcrm
await prisma.organization.update({
where: { id: TESTCRM_ORG_ID },
data: { wabaId: WABA_ID }
});
console.log(`✅ WABA ID mis à jour sur testcrm : ${WABA_ID}`);
// 3. Retirer le WABA ID de default-org-id (il était incorrect)
await prisma.organization.update({
where: { id: 'default-org-id' },
data: { wabaId: null }
});
console.log(`✅ WABA ID retiré de default-org-id`);
console.log('\n🎉 testcrm est maintenant connecté au numéro +221 78 822 76 76');
await prisma.$disconnect();
}
main().catch(console.error);