feat(abonnements): paliers LLM Essentielle/Premium, admin modeles par forfait, statistiques revenus, emails marketing
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m51s

- Gamme officielle : Essentielle (Pro) = deepseek-v4-flash, glm-5.3-flash,
  minimax-m3 ; Premium (Business) = claude-sonnet-5, deepseek-v4-pro, glm-5.3
- Routage reel : le modele employe suit le palier IA du forfait (reglages
  admin > defaut du plan), garde anti-croisement de palier
- Nouvelle page admin « Modeles & abonnements » (matrice forfaits/paliers,
  modele par defaut, catalogue OpenRouter)
- Statistiques enrichies : revenus (30 j + total), MRR estime, credits,
  liste d'attente, paliers utilises
- Nouvelle page admin « Marketing » : audiences avec compteurs, apercu,
  envoi test obligatoire, historique, desabonnement public + en-tetes
  List-Unsubscribe ; .gitignore pour les donnees d'execution
- Interface (accueil + tarifs) alignee sur la gamme, 13 langues completes
- Tests : routage par palier (fonction + tache), marketing, revenus en base
This commit is contained in:
2026-09-05 12:51:49 +02:00
parent 4e6850d6b1
commit 6c26712687
76 changed files with 5289 additions and 271 deletions

View File

@@ -31,10 +31,24 @@ import os
# NOTE: Stripe price IDs must be set via env vars in production.
# Create products/prices in Stripe Dashboard: https://dashboard.stripe.com/products
#
# LLM models used (via OpenRouter — June 2026):
# Essentielle : deepseek/deepseek-chat (DeepSeek V4/V3)
# Premium : anthropic/claude-sonnet-4.6 (Claude Sonnet 4.6)
# or google/gemini-3.5-flash (Gemini 3.5 Flash)
# Official LLM ranges (via OpenRouter — September 2026). The model used per
# translation is resolved from the plan's AI tier (admin settings > plan default):
# Essentielle (Pro plan) : deepseek/deepseek-v4-flash, z-ai/glm-5.3-flash,
# minimax/minimax-m3
# Premium (Business) : anthropic/claude-sonnet-5 (default),
# alternatives deepseek/deepseek-v4-pro, z-ai/glm-5.3
# A Pro user must never trigger a Premium model (see translate_routes).
DEFAULT_AI_MODELS_ESSENTIAL = [
"deepseek/deepseek-v4-flash",
"z-ai/glm-5.3-flash",
"minimax/minimax-m3",
]
DEFAULT_AI_MODELS_PREMIUM = [
"anthropic/claude-sonnet-5",
"deepseek/deepseek-v4-pro",
"z-ai/glm-5.3",
]
PLANS = {
PlanType.FREE: {
"name": "Free",
@@ -97,7 +111,7 @@ PLANS = {
"max_file_size_mb": 25,
"max_chars_per_month": 2_000_000,
"providers": ["google", "google_cloud", "openrouter"],
"ai_model_essential": "deepseek/deepseek-chat",
"ai_models_essential": list(DEFAULT_AI_MODELS_ESSENTIAL),
"features": [
"pricing.plans.pro.feat1",
"pricing.plans.pro.feat2",
@@ -127,8 +141,8 @@ PLANS = {
"max_file_size_mb": 50,
"max_chars_per_month": 10_000_000,
"providers": ["google", "google_cloud", "openrouter", "openrouter_premium", "openai", "zai"],
"ai_model_essential": "deepseek/deepseek-chat",
"ai_model_premium": "anthropic/claude-sonnet-4.6",
"ai_models_essential": list(DEFAULT_AI_MODELS_ESSENTIAL),
"ai_models_premium": list(DEFAULT_AI_MODELS_PREMIUM),
"features": [
"pricing.plans.business.feat1",
"pricing.plans.business.feat2",