feat: add appointments, campaigns, admin, storage, tests and various updates

- Add new routers: admin, appointments, campaigns
- Add storage service and logging config
- Add migrations directory and test suite with pytest config
- Add supabase_migration_features.sql
- Update models, dependencies, config, and existing routers
- Remove whatsapp_service (deleted)
- Update pyproject.toml and uv.lock dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
belviskhoremk
2026-04-03 09:11:58 +00:00
parent 9dccc83293
commit 92d4c2fc5e
51 changed files with 7076 additions and 515 deletions

View File

@@ -55,13 +55,6 @@ class Settings(BaseSettings):
# Supabase Storage
supabase_storage_url: str = ""
# WhatsApp Cloud API
whatsapp_access_token: str = ""
whatsapp_phone_number_id: str = ""
whatsapp_verify_token: str = "contexta_whatsapp_verify"
whatsapp_app_secret: str = ""
whatsapp_display_number: str = "" # E.164 without '+', e.g. "15551234567"
@property
def allowed_origins_list(self) -> List[str]:
return [o.strip() for o in self.allowed_origins.split(",")]
@@ -188,7 +181,7 @@ DEFAULT_MODELS = {
# ═══════════════════════════════════════════════════════════════════════════════
# PLAN LIMITS — Pricing: Starter $12/mo, Business $29/mo, Agency $79/mo
# PLAN LIMITS — Pricing: Starter $19/mo, Business $49/mo, Agency $99/mo
# ═══════════════════════════════════════════════════════════════════════════════
#
# Cost analysis (per 1M tokens approx):
@@ -207,9 +200,9 @@ DEFAULT_MODELS = {
# Fireworks models: ~$0.001-$0.004 per conversation
# GPT-4o: ~$0.015 per conversation
#
# Starter $12/mo, 1500 convos: max cost ~$6/mo (fireworks mix) → margin OK
# Business $29/mo, 5000 convos: max cost ~$15/mo (mixed models) → margin OK
# Agency $79/mo, 20000 convos: max cost ~$30/mo (fireworks) → healthy margin
# Starter $19/mo, 1500 convos: max cost ~$6/mo (fireworks mix) → margin OK
# Business $49/mo, 5000 convos: max cost ~$15/mo (mixed models) → margin OK
# Agency $99/mo, 20000 convos: max cost ~$30/mo (fireworks) → healthy margin
# ═══════════════════════════════════════════════════════════════════════════════
_ALL_FIREWORKS = [
@@ -229,52 +222,76 @@ PLAN_LIMITS = {
# Build, test, and go live with one chatbot — no card needed.
"free": {
"max_chatbots": 999999,
"max_published": 1, # can publish 1 chatbot
"max_published": 1, # can publish 1 chatbot
"max_documents_per_chatbot": 3,
"max_document_size_mb": 5,
"models": ["accounts/fireworks/models/llama-v3p3-70b-instruct"],
"conversations_limit": 100, # 100 real conversations/month
"conversations_limit": 100, # 100 real conversations/month
"code_export": False,
"analytics": False,
"channels": [], # no messaging channels
"gap_suggestions": False,
"channels": [], # no messaging channels
"url_sources": 0,
"leads_per_month": 0,
"show_branding": True, # cannot remove badge
"inbox_replies": False, # read-only inbox
"leads_editing": False, # view-only leads
"show_branding": True, # cannot remove badge
"appointments": False,
"appointments_chatbots": 0,
"campaigns": False,
"campaigns_per_month": 0,
"max_campaign_recipients": 0,
},
# ── Starter $12/mo ───────────────────────────────────────────────────────
# For individuals and solo businesses going live.
# ── Starter $19/mo ───────────────────────────────────────────────────────
# For solo operators: live chat, leads, booking, and campaigns.
"starter": {
"max_chatbots": 999999,
"max_published": 1,
"max_published": 3,
"max_documents_per_chatbot": 10,
"max_document_size_mb": 10,
"models": _ALL_FIREWORKS,
"conversations_limit": 1500,
"code_export": False,
"analytics": True,
"gap_suggestions": False,
"channels": ["telegram"],
"url_sources": 5,
"leads_per_month": 500,
"show_branding": True, # badge stays
"inbox_replies": True,
"leads_editing": True,
"show_branding": True, # badge stays on Starter
"appointments": True,
"appointments_chatbots": 1, # booking on 1 chatbot
"campaigns": True,
"campaigns_per_month": 3,
"max_campaign_recipients": 500,
},
# ── Business $29/mo ──────────────────────────────────────────────────────
# For growing businesses that need more chatbots and WhatsApp reach.
# ── Business $49/mo ──────────────────────────────────────────────────────
# For growing businesses: premium AI, unlimited booking, full analytics.
"business": {
"max_chatbots": 999999,
"max_published": 3,
"max_published": 10,
"max_documents_per_chatbot": 50,
"max_document_size_mb": 50,
"models": _ALL_FIREWORKS + _ALL_PREMIUM,
"conversations_limit": 5000,
"code_export": False,
"analytics": True,
"channels": ["telegram", "whatsapp"],
"gap_suggestions": True,
"channels": ["telegram"],
"url_sources": 999999,
"leads_per_month": 999999,
"show_branding": False, # can remove badge
"inbox_replies": True,
"leads_editing": True,
"show_branding": False, # can remove badge
"appointments": True,
"appointments_chatbots": 999999,
"campaigns": True,
"campaigns_per_month": 999999,
"max_campaign_recipients": 5000,
},
# ── Agency $79/mo ────────────────────────────────────────────────────────
# For agencies and large businesses managing many chatbots.
# ── Agency $99/mo ────────────────────────────────────────────────────────
# For agencies: unlimited everything, unlimited campaign recipients.
"agency": {
"max_chatbots": 999999,
"max_published": 999999,
@@ -284,10 +301,18 @@ PLAN_LIMITS = {
"conversations_limit": 20000,
"code_export": True,
"analytics": True,
"channels": ["telegram", "whatsapp"],
"gap_suggestions": True,
"channels": ["telegram"],
"url_sources": 999999,
"leads_per_month": 999999,
"inbox_replies": True,
"leads_editing": True,
"show_branding": False,
"appointments": True,
"appointments_chatbots": 999999,
"campaigns": True,
"campaigns_per_month": 999999,
"max_campaign_recipients": 999999,
},
# ── Enterprise (custom) ───────────────────────────────────────────────────
"enterprise": {
@@ -299,9 +324,17 @@ PLAN_LIMITS = {
"conversations_limit": 999999,
"code_export": True,
"analytics": True,
"channels": ["telegram", "whatsapp"],
"gap_suggestions": True,
"channels": ["telegram"],
"url_sources": 999999,
"leads_per_month": 999999,
"inbox_replies": True,
"leads_editing": True,
"show_branding": False,
"appointments": True,
"appointments_chatbots": 999999,
"campaigns": True,
"campaigns_per_month": 999999,
"max_campaign_recipients": 999999,
},
}