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 PHONE_NUMBER_ID = '1135406776315489'; | |
| const DISPLAY_PHONE = '+221 78 822 76 76'; | |
| const WABA_ID = '1503271284790621'; | |
| const ORG_ID = 'default-org-id'; | |
| // 1. Mise à jour du WABA ID sur l'organisation | |
| await prisma.organization.update({ | |
| where: { id: ORG_ID }, | |
| data: { wabaId: WABA_ID } | |
| }); | |
| console.log(`✅ WABA ID mis à jour : ${WABA_ID}`); | |
| // 2. Enregistrement du numéro de production | |
| await prisma.whatsAppPhoneNumber.upsert({ | |
| where: { id: PHONE_NUMBER_ID }, | |
| update: { displayPhone: DISPLAY_PHONE, organizationId: ORG_ID }, | |
| create: { id: PHONE_NUMBER_ID, displayPhone: DISPLAY_PHONE, organizationId: ORG_ID } | |
| }); | |
| console.log(`✅ Numéro enregistré : ${DISPLAY_PHONE} (ID: ${PHONE_NUMBER_ID})`); | |
| await prisma.$disconnect(); | |
| } | |
| main().catch(console.error); | |