mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Add simplified test data without optional contact email
Add simplified test data to `sql/create_test_data_simple.sql` including suppliers and groups without optional fields, and perform test insertions for `avoirs` to verify core functionality. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/2Jd7tYp
This commit is contained in:
1 parent
fd97136e10
commit
4ff6e992c0
1 file changed
+41
@@ -0,0 +1,41 @@
|
||||
-- 🔧 CRÉATION DONNÉES DE TEST SIMPLIFIÉES
|
||||
-- Sans colonnes optionnelles, juste les colonnes essentielles
|
||||
|
||||
-- 1. Créer un fournisseur de test (sans contact_email)
|
||||
INSERT INTO suppliers (name) VALUES ('Fournisseur Test')
|
||||
ON CONFLICT DO NOTHING
|
||||
RETURNING id;
|
||||
|
||||
-- 2. Créer un groupe de test
|
||||
INSERT INTO groups (name) VALUES ('Magasin Test')
|
||||
ON CONFLICT DO NOTHING
|
||||
RETURNING id;
|
||||
|
||||
-- 3. Vérifier qu'on a au moins un utilisateur
|
||||
SELECT 'Utilisateurs disponibles:', COUNT(*) FROM users;
|
||||
SELECT 'Premier utilisateur:', id FROM users LIMIT 1;
|
||||
|
||||
-- 4. Test d'insertion avoir avec les données créées
|
||||
INSERT INTO avoirs (
|
||||
supplier_id,
|
||||
group_id,
|
||||
invoice_reference,
|
||||
amount,
|
||||
comment,
|
||||
commercial_processed,
|
||||
created_by
|
||||
) VALUES (
|
||||
(SELECT id FROM suppliers WHERE name = 'Fournisseur Test' LIMIT 1),
|
||||
(SELECT id FROM groups WHERE name = 'Magasin Test' LIMIT 1),
|
||||
'TEST-FINAL-' || EXTRACT(EPOCH FROM NOW()),
|
||||
75.50,
|
||||
'Test insertion production',
|
||||
false,
|
||||
(SELECT id FROM users LIMIT 1)::varchar
|
||||
) RETURNING id, supplier_id, group_id, created_by, created_at;
|
||||
|
||||
-- 5. Vérification finale
|
||||
SELECT COUNT(*) as total_avoirs FROM avoirs;
|
||||
|
||||
-- 6. Nettoyer le test si vous voulez
|
||||
-- DELETE FROM avoirs WHERE comment = 'Test insertion production';
|
||||
Reference in new issue
Block a user