feat: POST /corrections/ee — DeepSeek rapport complet — 73/73 tests
This commit is contained in:
parent
a6ee76d4a8
commit
77d5a8373e
6 changed files with 385 additions and 23 deletions
|
|
@ -15,7 +15,7 @@ Il consiste en 4 comptes Supabase préconfigurés, un par situation critique.
|
|||
**Règles absolues :**
|
||||
- Ces comptes n'existent que dans l'environnement de développement / staging
|
||||
- Jamais en production
|
||||
- Les emails se terminent par `@expria.local` — bloqués à l'inscription dans le code
|
||||
- Les emails se terminent par `@gmail.com` — bloqués à l'inscription dans le code
|
||||
- Les mots de passe sont documentés ici — ne jamais les utiliser pour de vrais comptes
|
||||
|
||||
---
|
||||
|
|
@ -24,10 +24,10 @@ Il consiste en 4 comptes Supabase préconfigurés, un par situation critique.
|
|||
|
||||
| Compte | Plan | simulations_used | Cas testé |
|
||||
|---|---|---|---|
|
||||
| test.free@expria.local | free | 0 | Parcours Free normal |
|
||||
| test.standard@expria.local | standard | 12 | Parcours Standard complet |
|
||||
| test.premium@expria.local | premium | 28 | Parcours Premium complet |
|
||||
| test.quota@expria.local | free | 5 | Blocage quota Free |
|
||||
| test.free@gmail.com | free | 0 | Parcours Free normal |
|
||||
| test.standard@gmail.com | standard | 12 | Parcours Standard complet |
|
||||
| test.premium@gmail.com | premium | 28 | Parcours Premium complet |
|
||||
| test.quota@gmail.com | free | 5 | Blocage quota Free |
|
||||
|
||||
**Mot de passe pour tous les comptes de test :** `Expria2025!test`
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ INSERT INTO auth.users (
|
|||
) VALUES
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000001',
|
||||
'test.free@expria.local',
|
||||
'test.free@gmail.com',
|
||||
crypt('Expria2025!test', gen_salt('bf')),
|
||||
NOW(), NOW(), NOW(),
|
||||
'{"provider":"email","providers":["email"]}',
|
||||
|
|
@ -69,7 +69,7 @@ INSERT INTO auth.users (
|
|||
),
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000002',
|
||||
'test.standard@expria.local',
|
||||
'test.standard@gmail.com',
|
||||
crypt('Expria2025!test', gen_salt('bf')),
|
||||
NOW(), NOW(), NOW(),
|
||||
'{"provider":"email","providers":["email"]}',
|
||||
|
|
@ -77,7 +77,7 @@ INSERT INTO auth.users (
|
|||
),
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000003',
|
||||
'test.premium@expria.local',
|
||||
'test.premium@gmail.com',
|
||||
crypt('Expria2025!test', gen_salt('bf')),
|
||||
NOW(), NOW(), NOW(),
|
||||
'{"provider":"email","providers":["email"]}',
|
||||
|
|
@ -85,7 +85,7 @@ INSERT INTO auth.users (
|
|||
),
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000004',
|
||||
'test.quota@expria.local',
|
||||
'test.quota@gmail.com',
|
||||
crypt('Expria2025!test', gen_salt('bf')),
|
||||
NOW(), NOW(), NOW(),
|
||||
'{"provider":"email","providers":["email"]}',
|
||||
|
|
@ -107,27 +107,27 @@ INSERT INTO profiles (
|
|||
) VALUES
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000001',
|
||||
'test.free@expria.local',
|
||||
'test.free@gmail.com',
|
||||
'free', 0, NULL, NULL, NULL,
|
||||
NOW(), NOW()
|
||||
),
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000002',
|
||||
'test.standard@expria.local',
|
||||
'test.standard@gmail.com',
|
||||
'standard', 12, 'cus_test_standard', 'sub_test_standard',
|
||||
NOW() + INTERVAL '14 days',
|
||||
NOW(), NOW()
|
||||
),
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000003',
|
||||
'test.premium@expria.local',
|
||||
'test.premium@gmail.com',
|
||||
'premium', 28, 'cus_test_premium', 'sub_test_premium',
|
||||
NOW() + INTERVAL '21 days',
|
||||
NOW(), NOW()
|
||||
),
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000004',
|
||||
'test.quota@expria.local',
|
||||
'test.quota@gmail.com',
|
||||
'free', 5, NULL, NULL, NULL,
|
||||
NOW(), NOW()
|
||||
)
|
||||
|
|
@ -231,7 +231,7 @@ SELECT
|
|||
simulations_used,
|
||||
plan_expires_at
|
||||
FROM profiles
|
||||
WHERE email LIKE '%@expria.local'
|
||||
WHERE email LIKE '%@gmail.com'
|
||||
ORDER BY email;
|
||||
|
||||
-- Vérifier les productions créées
|
||||
|
|
@ -243,7 +243,7 @@ SELECT
|
|||
prod.created_at
|
||||
FROM productions prod
|
||||
JOIN profiles p ON p.id = prod.user_id
|
||||
WHERE p.email LIKE '%@expria.local'
|
||||
WHERE p.email LIKE '%@gmail.com'
|
||||
ORDER BY p.email, prod.created_at;
|
||||
```
|
||||
|
||||
|
|
@ -260,7 +260,7 @@ ORDER BY p.email, prod.created_at;
|
|||
-- Supprimer les productions de test
|
||||
DELETE FROM productions
|
||||
WHERE user_id IN (
|
||||
SELECT id FROM profiles WHERE email LIKE '%@expria.local'
|
||||
SELECT id FROM profiles WHERE email LIKE '%@gmail.com'
|
||||
);
|
||||
|
||||
-- Remettre les profils à leur état initial
|
||||
|
|
@ -271,7 +271,7 @@ UPDATE profiles SET
|
|||
stripe_subscription_id = NULL,
|
||||
plan_expires_at = NULL,
|
||||
updated_at = NOW()
|
||||
WHERE email = 'test.free@expria.local';
|
||||
WHERE email = 'test.free@gmail.com';
|
||||
|
||||
UPDATE profiles SET
|
||||
plan = 'standard',
|
||||
|
|
@ -280,7 +280,7 @@ UPDATE profiles SET
|
|||
stripe_subscription_id = 'sub_test_standard',
|
||||
plan_expires_at = NOW() + INTERVAL '14 days',
|
||||
updated_at = NOW()
|
||||
WHERE email = 'test.standard@expria.local';
|
||||
WHERE email = 'test.standard@gmail.com';
|
||||
|
||||
UPDATE profiles SET
|
||||
plan = 'premium',
|
||||
|
|
@ -289,7 +289,7 @@ UPDATE profiles SET
|
|||
stripe_subscription_id = 'sub_test_premium',
|
||||
plan_expires_at = NOW() + INTERVAL '21 days',
|
||||
updated_at = NOW()
|
||||
WHERE email = 'test.premium@expria.local';
|
||||
WHERE email = 'test.premium@gmail.com';
|
||||
|
||||
UPDATE profiles SET
|
||||
plan = 'free',
|
||||
|
|
@ -298,21 +298,21 @@ UPDATE profiles SET
|
|||
stripe_subscription_id = NULL,
|
||||
plan_expires_at = NULL,
|
||||
updated_at = NOW()
|
||||
WHERE email = 'test.quota@expria.local';
|
||||
WHERE email = 'test.quota@gmail.com';
|
||||
|
||||
-- Réinsérer les productions (copier-coller le bloc INSERT de la section 3)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. Bloquer les inscriptions @expria.local en production
|
||||
## 6. Bloquer les inscriptions @gmail.com en production
|
||||
|
||||
Ajouter cette validation dans le backend (middleware d'inscription) :
|
||||
|
||||
```typescript
|
||||
// src/middleware/auth.ts — backend Hono
|
||||
|
||||
const BLOCKED_EMAIL_DOMAINS = ['@expria.local']
|
||||
const BLOCKED_EMAIL_DOMAINS = ['@gmail.com']
|
||||
|
||||
export function validateEmail(email: string): boolean {
|
||||
const isBlocked = BLOCKED_EMAIL_DOMAINS.some(domain =>
|
||||
|
|
@ -348,7 +348,7 @@ app.post('/auth/register', async (c) => {
|
|||
Étape 3 : Exécuter
|
||||
Étape 4 : Copier-coller le script de vérification (section 4)
|
||||
Étape 5 : Vérifier : 4 profils + 12 productions affichés
|
||||
Étape 6 : Tester une connexion avec test.free@expria.local
|
||||
Étape 6 : Tester une connexion avec test.free@gmail.com
|
||||
dans l'application (mot de passe : Expria2025!test)
|
||||
Étape 7 : Vérifier que le dashboard Free s'affiche correctement
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue