- BusinessHoursChecker: loads schedule from CMS site-settings,
sends auto-away messages outside business hours with next-open time
- Media handling: image+caption forwarded to LLM, image-only/doc/audio/
video get appropriate responses, stickers ignored, location acknowledged
- DSGVO ConsentManager: interactive buttons for consent, revocation
keywords, consent logging via API key to consent-logs collection
- ConversationManager: consent fields (consentGiven, consentTimestamp)
with grantConsent/revokeConsent methods
- InteractionWriter: media attachments stored as whatsapp-media references
- MessageRouter: integrates all features in order:
business hours → consent → media → escalation → rules → LLM
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WHATSAPP_PLATFORM_ID and WHATSAPP_ACCOUNT_ID can now be set in .env
to match CMS entity IDs on different environments (dev vs production).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Payload REST API expects group fields as nested objects (e.g.
`author: { name: "...", handle: "..." }`), not dot-notation or flat
field names. Also adds platform/socialAccount relationship IDs and
proper flags/analysis/response group fields.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update Claude model from claude-3-5-haiku-20241022 to claude-haiku-4-5-20251001
- Replace static API key auth with JWT login (auto-refresh before 2h expiry)
- Fix TemplateResolver: use 'template' field (not 'content'), remove non-existent tenant filter
- Fix RulesLoader: remove non-existent tenant filter from community-rules queries
- Update config: PAYLOAD_BOT_EMAIL/PASSWORD replace PAYLOAD_API_KEY
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Payload API returns 403 without auth, which is fine for health checks.
New isReachable() method accepts any non-5xx response as healthy.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Node.js doesn't load .env files automatically. Using Node 22's
native --env-file flag instead of adding dotenv dependency.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Direct DB (pg Pool) not reachable from sv-whatsapp LXC to sv-postgres.
Using Payload REST API via PayloadClient as interim solution.
DATABASE_URL is now optional in config.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 1 implementation with all core modules:
- Fastify webhook server with Meta signature validation
- WhatsApp Cloud API client (send text/template/interactive, mark as read)
- LLM abstraction layer with Claude provider (Haiku for speed)
- BullMQ message processing pipeline (dedup, rate limiting)
- Bot routing (MessageRouter, ConversationManager, EscalationManager)
- Payload CMS integration (InteractionWriter via direct DB, RulesLoader, TemplateResolver)
- Healthcare-safe system prompt with medical keyword detection
- PM2 ecosystem config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>