Add full WhatsApp Cloud API integration for Nexus POS: - Service layer (whatsapp_service.py): send text, templates, quotations, order confirmations, stock alerts; process incoming webhooks with AI auto-reply - Blueprint (whatsapp_bp.py): public webhook endpoints for Meta verification + incoming messages; authenticated endpoints for send, send-quote, conversations - Conversation UI (whatsapp.html + whatsapp.js): split-panel messenger with conversation list, chat bubbles, send input, quote sending; both themes - Migration v1.4: whatsapp_messages table with phone/direction/status indexes - Config: WHATSAPP_TOKEN, WHATSAPP_PHONE_ID, WHATSAPP_VERIFY_TOKEN env vars - Sidebar: WhatsApp nav item under Gestion with message-bubble icon - Ready for Meta Business credentials (infrastructure complete, no API keys needed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
962 B
Python
32 lines
962 B
Python
import os
|
|
|
|
MASTER_DB_URL = os.environ.get(
|
|
"MASTER_DB_URL",
|
|
"postgresql://nexus:nexus_autoparts_2026@localhost/nexus_autoparts"
|
|
)
|
|
|
|
TENANT_DB_URL_TEMPLATE = os.environ.get(
|
|
"TENANT_DB_URL_TEMPLATE",
|
|
"postgresql://nexus:nexus_autoparts_2026@localhost/{db_name}"
|
|
)
|
|
|
|
JWT_SECRET = os.environ.get("POS_JWT_SECRET", "nexus-pos-secret-change-in-prod-2026")
|
|
JWT_ACCESS_EXPIRES = 28800 # 8 hours (full shift)
|
|
JWT_REFRESH_EXPIRES = 2592000 # 30 days
|
|
|
|
PIN_MAX_ATTEMPTS_PER_MINUTE = 5
|
|
PIN_LOCKOUT_THRESHOLD = 10
|
|
PIN_LOCKOUT_MINUTES = 15
|
|
|
|
TENANT_TEMPLATE_DB = "tenant_template"
|
|
|
|
OPENROUTER_API_KEY = os.environ.get(
|
|
"OPENROUTER_API_KEY",
|
|
"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"
|
|
)
|
|
|
|
# WhatsApp Business Cloud API
|
|
WHATSAPP_TOKEN = os.environ.get("WHATSAPP_TOKEN", "")
|
|
WHATSAPP_PHONE_ID = os.environ.get("WHATSAPP_PHONE_ID", "")
|
|
WHATSAPP_VERIFY_TOKEN = os.environ.get("WHATSAPP_VERIFY_TOKEN", "nexus-wa-verify-2026")
|