File size: 4,538 Bytes
e0a103e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# config.py

# Fichier de configuration pour le backend ErnestMind 2.5
import os

# --- Configuration Baserow (Nouveau) ---
# Clés à définir dans les secrets d'environnement Hugging Face Space
BASEROW_DATABASE_ID = os.environ.get("BASEROW_DATABASE_ID") 
PRIMARY_USERS_TABLE_ID = os.environ.get("PRIMARY_USERS_TABLE_ID") 
END_USERS_TABLE_ID = os.environ.get("END_USERS_TABLE_ID")
# Le token d'accès API
BASEROW_API_TOKEN = os.environ.get("BASEROW_API_TOKEN")

# --- Configuration Stripe (Paiement) ---
# Clés à définir dans les secrets d'environnement Hugging Face Space
STRIPE_SECRET_KEY = os.environ.get("STRIPE_SECRET_KEY")
STRIPE_WEBHOOK_SECRET = os.environ.get("STRIPE_WEBHOOK_SECRET")
# Clé Publique (utilisée par le Frontend, mais stockée ici pour référence)
STRIPE_PUBLIC_KEY = os.environ.get("STRIPE_PUBLIC_KEY")

# --- Dictionnaire de Prix Central (Phase 1) ---
# Contient toutes les informations nécessaires pour le Frontend et le Backend.
# Les 'price_id' doivent correspondre aux IDs créés dans Stripe.
PLANS_CONFIG = {
    # Plan Gratuit
    "free": {
        "title": "Gratuit",
        "baserow_value": "Free", # <--- NOUVEAU: Mettre la valeur EXACTE attendue par Baserow (ex: GRATUIT, Free, etc.)
        "description": "Idéal pour les tests et les petits projets.",
        "limit": 500,
        "price_monthly": 0.0,
        "price_annual": 0.0,
        "price_id_monthly": None, 
        "price_id_annual": None,  
        "currency": "EUR"
    },
    # Plan Standard - Mensuel
    "standard_monthly": {
        "title": "Standard (Mensuel)",
        "description": "Pour les utilisateurs réguliers. Paiement mensuel.",
        "limit": 1000,
        "price_monthly": 19.99,
        "price_annual": 0.0,
        "price_id_monthly": "price_1OvXXXXXXX", # REMPLACER PAR VOTRE VRAI ID STRIPE
        "price_id_annual": None,
        "currency": "EUR"
    },
    # Plan Standard - Annuel
    "standard_annual": {
        "title": "Standard (Annuel)",
        "description": "Pour les utilisateurs réguliers. Économisez 20% en payant à l'année.",
        "limit": 1000,
        "price_monthly": 0.0,
        "price_annual": 199.90, 
        "price_id_monthly": None,
        "price_id_annual": "price_1OwYYYYYYY", # REMPLACER PAR VOTRE VRAI ID STRIPE
        "currency": "EUR"
    },
    # Plan Pro - Mensuel
    "pro_monthly": {
        "title": "Pro (Mensuel)",
        "description": "Pour les professionnels et les projets importants. Paiement mensuel.",
        "limit": 2000,
        "price_monthly": 49.99,
        "price_annual": 0.0,
        "price_id_monthly": "price_1OxZZZZZZZ", # REMPLACER PAR VOTRE VRAI ID STRIPE
        "price_id_annual": None,
        "currency": "EUR"
    },
    # Plan Pro - Annuel
    "pro_annual": {
        "title": "Pro (Annuel)",
        "description": "Pour les professionnels et les projets importants. Économisez 20% en payant à l'année.",
        "limit": 2000,
        "price_monthly": 0.0,
        "price_annual": 499.90, 
        "price_id_monthly": None,
        "price_id_annual": "price_1OyAAAAAAA", # REMPLACER PAR VOTRE VRAI ID STRIPE
        "currency": "EUR"
    },
    # Plan Illimité - Mensuel
    "illimited_monthly": {
        "title": "Illimité (Mensuel)",
        "description": "Sans aucune restriction, pour les grandes entreprises. Paiement mensuel.",
        "limit": float('inf'),
        "price_monthly": 99.99,
        "price_annual": 0.0,
        "price_id_monthly": "price_1OzBBBBBBB", # REMPLACER PAR VOTRE VRAI ID STRIPE
        "price_id_annual": None,
        "currency": "EUR"
    },
    # Plan Illimité - Annuel
    "illimited_annual": {
        "title": "Illimité (Annuel)",
        "description": "Sans aucune restriction, pour les grandes entreprises. Économisez 20% en payant à l'année.",
        "limit": float('inf'),
        "price_monthly": 0.0,
        "price_annual": 999.90, 
        "price_id_monthly": None,
        "price_id_annual": "price_1OzAACCCCC", # REMPLACER PAR VOTRE VRAI ID STRIPE
        "currency": "EUR"
    },
    # Plan Spécial pour les End-users (pas listé sur la page de prix)
    "end_user": {
        "title": "End-User",
        "description": "Compte utilisateur créé par un client.",
        "limit": 0,
        "price_monthly": 0.0,
        "price_annual": 0.0,
        "price_id_monthly": None,
        "price_id_annual": None,
        "currency": "EUR"
    },
}