Baseline commit of the existing Maquina Comercial Pessoal project

Tracks the app that was already in place (capture, treatment, outreach,
WhatsApp integration, server, frontend, tests, docs) so future feature
work can branch and use isolated worktrees.
This commit is contained in:
Gustavo
2026-07-31 10:54:07 -03:00
parent 6cd336a41e
commit d330bb5ff0
132 changed files with 29969 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import { loadDotEnv, paths } from '../src/env.mjs';
import { openDb, ensureSeeds } from '../src/db.mjs';
import { runOutreachBatch } from '../src/outreach/run.mjs';
import { createWhatsAppManager, hasWhatsAppSession } from '../src/whatsapp/manager.mjs';
// Dispara um lote pela sessao local existente, respeitando as mesmas regras do servidor.
await loadDotEnv();
const log = (message) => console.log(`[outreach] ${message}`);
const db = openDb();
await ensureSeeds(db, { log });
const whatsapp = createWhatsAppManager({ authDir: paths.whatsappAuth, log });
if (await hasWhatsAppSession(paths.whatsappAuth)) {
await whatsapp.connect().catch((error) => log(`conexao local falhou: ${error.message}`));
}
const resumo = await runOutreachBatch({ db, whatsapp, log });
console.log(JSON.stringify(resumo, null, 2));
await whatsapp.close();
db.close();