veza/docs/archive/v0-history/SMOKE_TEST_V0702.md
senke 0e7097ed1b chore(cleanup): J1 — purge 220MB debris, archive session docs (complete)
First-attempt commit 3a5c6e184 only 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 of bec75f143 (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 in
3a5c6e184 and remain in place — this commit does not modify .gitignore.

Refs: AUDIT_REPORT.md §11
2026-04-14 17:12:03 +02:00

181 lines
4.2 KiB
Markdown

# Smoke Test v0.702 — Reviews, Factures, Remboursements & Product Detail
## Prérequis
- `veza-backend-api` compilé et démarré (`go run ./cmd/api`)
- PostgreSQL avec migrations appliquées jusqu'à 116
- `.env` avec `DATABASE_URL`, `JWT_SECRET`, `HYPERSWITCH_API_KEY` (optionnel pour refund)
- Utilisateur enregistré avec token JWT valide
- Au moins 1 produit créé, 1 order completed avec license
---
## 1. Product Detail Route (W1)
### 1.1 Route accessible
```bash
# Frontend: naviguer vers /marketplace/products/:id
# Vérifier: la page charge avec le ProductDetailView
# Vérifier: le bouton Back redirige vers /marketplace
```
### 1.2 Lazy loading
```bash
# Ouvrir DevTools → Network
# Naviguer vers /marketplace/products/:id
# Vérifier: chunk ProductDetailPage chargé dynamiquement
```
---
## 2. Reviews (R1)
### 2.1 Lister les reviews
```bash
curl -s http://localhost:8080/api/v1/marketplace/products/{PRODUCT_ID}/reviews | jq .
# Attendu: { "success": true, "data": { "reviews": [...] } }
# Attendu: reviews triées par created_at DESC
```
### 2.2 Créer une review
```bash
curl -s -X POST http://localhost:8080/api/v1/marketplace/products/{PRODUCT_ID}/reviews \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{"rating": 5, "comment": "Excellent track!"}' | jq .
# Attendu: 201 Created, review avec id, product_id, buyer_id, rating, comment
```
### 2.3 Validation rating
```bash
curl -s -X POST http://localhost:8080/api/v1/marketplace/products/{PRODUCT_ID}/reviews \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{"rating": 0, "comment": "bad"}' | jq .
# Attendu: 400 Bad Request, "rating must be between 1 and 5"
```
### 2.4 Review dupliquée
```bash
# Deuxième appel POST avec le même buyer/product
# Attendu: 400/409, "review already exists"
```
### 2.5 Review sans achat
```bash
# Utiliser un token d'utilisateur qui n'a pas acheté le produit
# Attendu: 403, "you must purchase the product before reviewing"
```
---
## 3. Invoice PDF (F1)
### 3.1 Télécharger facture
```bash
curl -s -o invoice.pdf http://localhost:8080/api/v1/marketplace/orders/{ORDER_ID}/invoice \
-H "Authorization: Bearer {TOKEN}"
# Attendu: fichier PDF valide
file invoice.pdf
# Attendu: "PDF document"
```
### 3.2 Facture d'un autre buyer
```bash
# Utiliser un token d'un utilisateur différent
# Attendu: 403 Forbidden
```
### 3.3 Order inexistant
```bash
curl -s http://localhost:8080/api/v1/marketplace/orders/00000000-0000-0000-0000-000000000000/invoice \
-H "Authorization: Bearer {TOKEN}" | jq .
# Attendu: 404 Not Found
```
---
## 4. Refund (R2)
### 4.1 Refund buyer
```bash
curl -s -X POST http://localhost:8080/api/v1/marketplace/orders/{ORDER_ID}/refund \
-H "Authorization: Bearer {BUYER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"reason": "Not as described"}' | jq .
# Attendu: 200, "Refund initiated"
# Attendu: order.status = refunded
# Attendu: licenses revoked_at != null
```
### 4.2 Refund order non completed
```bash
# Order avec status = pending
# Attendu: 400, "order cannot be refunded"
```
### 4.3 Refund par tiers
```bash
# Token d'un utilisateur qui n'est ni buyer ni seller
# Attendu: 403, "you are not allowed to refund this order"
```
---
## 5. MSW (Storybook)
### 5.1 Stories ProductDetailView
```bash
cd apps/web && npm run storybook
# Naviguer vers Components/Features/Marketplace/ProductDetailView
# Vérifier: Default, Loading, Empty, WithReviews, Error
```
### 5.2 MSW reviews
```bash
# En mode MSW (npm run dev), naviguer vers /marketplace/products/:id
# Vérifier: les reviews mockées s'affichent dans la section Reviews
```
---
## 6. Tests automatisés
### 6.1 Backend
```bash
cd veza-backend-api && go test ./internal/core/marketplace/... -v -run "Review|Invoice|Refund"
# Attendu: 15 tests pass (6 reviews + 4 invoices + 5 refunds)
```
### 6.2 Frontend build
```bash
cd apps/web && npm run build
# Attendu: 0 errors, 0 warnings critiques
```
---
## 7. Documentation
- [ ] `docs/API_REFERENCE.md` contient sections Reviews, Invoices, Refunds
- [ ] `CHANGELOG.md` contient entrée v0.702
- [ ] `docs/PROJECT_STATE.md` : Dernier tag = v0.702
- [ ] `docs/FEATURE_STATUS.md` : section "Livré en v0.702"
- [ ] `git tag v0.702` créé sur le bon commit