← story.propek
STORY 6.14
LGPD Repetida, Toggle Não Desativa, Pipeline Stage
Epic: 6 — WhatsApp Bot
PENDING
ACCEPTANCE CRITERIA (4/4)
AC1: Antes de enviar a mensagem LGPD, verificar se `customer.lgpd_informed_at` já tem valor. Se já foi informado, NÃO enviar novamente.
AC2: A verificação deve usar o objeto `customer` já carregado no handler (sem query extra).
AC3: A mensagem LGPD é enviada NO MÁXIMO 1 vez por cliente (lifetime, não por conversa).
AC4: Log info quando LGPD é suprimida: `'LGPD already sent — skipping duplicate'`
TIMELINE
08/04/2026
docs: add Story 6.14 — bot bugfixes LGPD, toggle, pipeline [Story 6.14]
abea205
ARQUIVOS (5)
src/handlers/whatsapp.handler.ts Bug 1: check lgpd_informed_at; Bug 2: reordenar bot_muted antes de waiting_human
src/api/crm/conversations.ts Bug 2: take-over seta bot_muted=true, release seta bot_muted=false; Bug 3: take-over cria handoff_leads se não existe
src/services/handoff.service.ts Bug 3: pipeline_status explícito no INSERT
src/services/customer.service.ts Added `lgpd_informed_at` to Customer interface
src/services/notification.service.ts (sem mudança — referência)