Commit Graph
9 Commits
Author SHA1 Message Date
Gustavo 8600893496 Add deterministic variant selection and message rendering 2026-08-01 10:29:19 -03:00
GustavoandClaude Sonnet 5 577f48ab19 Fix: stamp semana_iniciada_em when campaign first transitions to 'rodando'
Previously, setCampaignStatus did not set semana_iniciada_em, causing
escalateWeeklyLimits to bail early (if (!campaign.semana_iniciada_em) continue).
Now when a campaign transitions to 'rodando' for the first time, semana_iniciada_em
is set to datetime('now'). Subsequent rodando transitions leave it unchanged
(using COALESCE to preserve first-run timestamp).

Regression tests confirm:
- First transition to 'rodando' stamps semana_iniciada_em
- Subsequent transitions do not reset the timestamp
- resumeCampaign continues to work correctly (pause/resume cycle)
- All 105 tests pass

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-01 10:25:00 -03:00
Gustavo fb2cd75a56 Add campaign-store: CRUD, opt-out and weekly limit escalation 2026-08-01 10:19:22 -03:00
Gustavo a7abd3d4d0 Add campaign outreach schema (migration v8) 2026-08-01 10:14:54 -03:00
Gustavo 4f736562f3 Carry over pre-existing WABA outreach automation WIP
This work already existed uncommitted in the main working tree (not
authored by this branch) and is required as a runtime dependency for the
campaign outreach port (zpro-client, templates, outreach routes/UI). Copied
in as-is, untouched, so this feature branch has a working baseline; the
original uncommitted state in the main checkout is left exactly as it was.
2026-08-01 10:12:25 -03:00
Gustavo 0894ab68b3 Ignore .worktrees/ directory 2026-08-01 10:09:32 -03:00
Gustavo 3ce12381d5 Add implementation plan for campaign outreach subsystem port
11-task TDD plan covering schema migration, campaign store, candidate
selection/queue, health metrics, send worker, scheduler, HTTP routes and
the Campanhas UI tab.
2026-08-01 10:08:07 -03:00
Gustavo 2195b3f2b1 Add design doc for campaign outreach subsystem port
Ports the Máquina Comercial Pessoal's campaign methodology (queue/preview/
approval, A/B/C variants, weekly limit escalation, health-based auto-pause,
stage classification, appointment scheduling), adapted for the Z-PRO/WABA
send layer and a dynamic operator-defined catalog instead of a hardcoded one.
2026-08-01 09:47:49 -03:00
DESKTOP-F2O4A80\UserandClaude b8d10b210c Commit inicial: GTI Maquina Comercial
App local (Node + SQLite) para captura, tratamento e exportacao de leads
comerciais, com dashboard de gestao, login/usuarios e integracao Z-PRO.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-12 14:22:21 -03:00