First-attempt commit3a5c6e184only captured the .gitignore change; the pre-commit hook silently dropped the 343 staged moves/deletes during lint-staged's "no matching task" path. This commit re-applies the intended J1 content on top ofbec75f143(which was pushed in parallel). Uses --no-verify because: - J1 only touches .md/.json/.log/.png/binaries — zero code that would benefit from lint-staged, typecheck, or vitest - The hook demonstrated it corrupts pure-rename commits in this repo - Explicitly authorized by user for this one commit Changes (343 total: 169 deletions + 174 renames): Binaries purged (~167 MB): - veza-backend-api/{server,modern-server,encrypt_oauth_tokens,seed,seed-v2} Generated reports purged: - 9 apps/web/lint_report*.json (~32 MB) - 8 apps/web/tsc_*.{log,txt} + ts_*.log (TS error snapshots) - 3 apps/web/storybook_*.json (1375+ stored errors) - apps/web/{build_errors*,build_output,final_errors}.txt - 70 veza-backend-api/coverage*.out + coverage_groups/ (~4 MB) - 3 veza-backend-api/internal/handlers/*.bak Root cleanup: - 54 audit-*.png (visual regression baselines, ~11 MB) - 9 stale MVP-era scripts (Jan 27, hardcoded v0.101): start_{iteration,mvp,recovery}.sh, test_{mvp_endpoints,protected_endpoints,user_journey}.sh, validate_v0101.sh, verify_logs_setup.sh, gen_hash.py Session docs archived (not deleted — preserved under docs/archive/): - 78 apps/web/*.md → docs/archive/frontend-sessions-2026/ - 43 veza-backend-api/*.md → docs/archive/backend-sessions-2026/ - 53 docs/{RETROSPECTIVE_V,SMOKE_TEST_V,PLAN_V0_,V0_*_RELEASE_SCOPE, AUDIT_,PLAN_ACTION_AUDIT,REMEDIATION_PROGRESS}*.md → docs/archive/v0-history/ README.md and CONTRIBUTING.md preserved in apps/web/ and veza-backend-api/. Note: The .gitignore rules preventing recurrence were already pushed in3a5c6e184and remain in place — this commit does not modify .gitignore. Refs: AUDIT_REPORT.md §11
5.8 KiB
5.8 KiB
Smoke Test v0.901 — Marketplace Complet & Analytics Avancés
Prérequis
veza-backend-apicompilé et démarré- PostgreSQL avec migrations appliquées jusqu'à 128
.envavecDATABASE_URL,JWT_SECRET- MaxMind GeoIP2-Lite database téléchargée (pour geography)
- Utilisateur standard + admin avec tokens JWT
- Produits, orders et track plays existants en DB
1. Wishlist (MK1)
1.1 Ajouter à la wishlist
curl -s -X POST http://localhost:8080/api/v1/marketplace/wishlist/{PRODUCT_ID} \
-H "Authorization: Bearer {TOKEN}" | jq .
# Attendu: 200/201, produit ajouté
1.2 Lister la wishlist
curl -s http://localhost:8080/api/v1/marketplace/wishlist \
-H "Authorization: Bearer {TOKEN}" | jq .
# Attendu: 200, liste des produits wishlistés
1.3 Retirer de la wishlist
curl -s -X DELETE http://localhost:8080/api/v1/marketplace/wishlist/{PRODUCT_ID} \
-H "Authorization: Bearer {TOKEN}" | jq .
# Attendu: 200, produit retiré
1.4 Frontend
# Naviguer vers /marketplace
# Vérifier: icône coeur sur chaque ProductCard
# Cliquer coeur → produit ajouté (coeur rempli)
# Naviguer vers /marketplace/wishlist → produit listé
2. Promotions (MK1)
2.1 Créer une promotion
curl -s -X POST http://localhost:8080/api/v1/marketplace/promotions \
-H "Authorization: Bearer {SELLER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"product_id": "{PRODUCT_ID}", "discount_percent": 30, "starts_at": "2026-02-24T00:00:00Z", "ends_at": "2026-03-01T00:00:00Z"}' | jq .
# Attendu: 201, promotion créée
2.2 Badge promo visible
# Frontend: naviguer vers /marketplace
# Vérifier: badge "PROMO -30%" sur le produit en promotion
# Vérifier: prix barré + nouveau prix affiché
2.3 Page deals
# Frontend: naviguer vers /marketplace/deals
# Vérifier: uniquement les produits en promotion active
# Vérifier: countdown timer jusqu'à fin de promotion
3. Disputes (MK1)
3.1 Ouvrir une dispute
curl -s -X POST http://localhost:8080/api/v1/marketplace/orders/{ORDER_ID}/dispute \
-H "Authorization: Bearer {BUYER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"reason": "Product files corrupted", "details": "Cannot open the WAV file"}' | jq .
# Attendu: 201, dispute ouverte
3.2 Admin liste disputes
curl -s http://localhost:8080/api/v1/admin/disputes \
-H "Authorization: Bearer {ADMIN_TOKEN}" | jq .
# Attendu: 200, liste des disputes avec status
3.3 Résoudre une dispute
curl -s -X POST http://localhost:8080/api/v1/admin/disputes/{DISPUTE_ID}/resolve \
-H "Authorization: Bearer {ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"resolution": "refund", "note": "Product was indeed corrupted"}' | jq .
# Attendu: 200, dispute resolved
4. Review Reply (MK1)
4.1 Répondre à une review
curl -s -X POST http://localhost:8080/api/v1/marketplace/reviews/{REVIEW_ID}/reply \
-H "Authorization: Bearer {SELLER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"reply": "Thank you for the feedback! I have uploaded a fixed version."}' | jq .
# Attendu: 200, reply ajoutée
4.2 Reply visible
# Frontend: naviguer vers /marketplace/products/:id → section reviews
# Vérifier: reply du vendeur affichée sous la review
5. Re-download (MK1)
5.1 Télécharger les fichiers achetés
curl -s http://localhost:8080/api/v1/marketplace/orders/{ORDER_ID}/download \
-H "Authorization: Bearer {BUYER_TOKEN}" | jq .
# Attendu: 200, { "download_urls": [{ "filename": "...", "url": "signed-s3-url", "expires_in": 300 }] }
6. Taxes (MK1)
6.1 Checkout avec taxes
# Frontend: ajouter un produit au panier, procéder au checkout
# Vérifier: OrderSummary affiche "Tax (20%)" pour un utilisateur FR
# Vérifier: total = subtotal + tax
7. Creator Analytics (AN1)
7.1 Géographie
curl -s http://localhost:8080/api/v1/analytics/geography \
-H "Authorization: Bearer {TOKEN}" | jq .
# Attendu: 200, { "countries": [{ "code": "FR", "name": "France", "plays": 150 }, ...] }
7.2 Démographie
curl -s http://localhost:8080/api/v1/analytics/demographics \
-H "Authorization: Bearer {TOKEN}" | jq .
# Attendu: 200, breakdown par device_type, os, browser
7.3 Revenue projection
curl -s http://localhost:8080/api/v1/analytics/revenue/projection \
-H "Authorization: Bearer {TOKEN}" | jq .
# Attendu: 200, projections 30/60/90 jours
7.4 Frontend analytics
# Naviguer vers /analytics
# Vérifier: onglets Geography (carte), Demographics (donut), Traffic (bar), Revenue (line + projection)
8. Admin Analytics (AN2)
8.1 DAU/MAU
curl -s http://localhost:8080/api/v1/admin/analytics/users \
-H "Authorization: Bearer {ADMIN_TOKEN}" | jq .
# Attendu: 200, { "dau": 42, "mau": 350, "ratio": 0.12 }
8.2 Retention
curl -s http://localhost:8080/api/v1/admin/analytics/retention \
-H "Authorization: Bearer {ADMIN_TOKEN}" | jq .
# Attendu: 200, { "d1": 0.65, "d7": 0.40, "d30": 0.25 }
8.3 Transactions
curl -s http://localhost:8080/api/v1/admin/analytics/transactions \
-H "Authorization: Bearer {ADMIN_TOKEN}" | jq .
# Attendu: 200, { "total_revenue_cents": ..., "total_orders": ..., "avg_order_cents": ... }
9. Tests automatisés
cd veza-backend-api && go test ./... -v
cd apps/web && npm run build
10. Documentation
docs/API_REFERENCE.mdsections Wishlist, Promotions, Disputes, AnalyticsCHANGELOG.mdcontient entrée v0.901docs/PROJECT_STATE.md: Dernier tag = v0.901docs/FEATURE_STATUS.md: section "Livré en v0.901"git tag v0.901créé