Resi Shopify + notifiche merchant + A6 (finestra/esclusioni) + dashboard recessi
Integrazione Resi Shopify: - Alla conferma del recesso, crea un Reso nativo (returnCreate) per gli ordini evasi -> gestione nella UI Resi nativa. Ordini non evasi: skip (merchant gestisce annullo/rimborso). Query via order.fulfillments (returnableFulfillments non esiste nella API 2026-04). Campo WithdrawalRequest.shopifyReturnId. Notifiche al merchant (dietro toggle Settings): - Email di notifica a ogni recesso (sendMerchantNotification) + tag "Recesso" sull'ordine (tagsAdd, scope write_orders). Toggle notifyEnabled/notifyEmail/tagEnabled. A6 - completezza compliance (dietro toggle, default OFF, non tocca il flusso testato): - Finestra 14gg: computeDeadline/isWindowExpired (rif = data evasione o ordine + defaultWindowDays). Esclusioni Art. 59: checkExclusions su regole ExclusionRule (ALL/PRODUCT/TAG). lookupOrder esteso (fulfillments + lineItems product/tags). checkCompliance() aggancia lookup+confirm. Toggle enforceWindow/enforceExclusions. - Pagina admin Esclusioni (CRUD regole) + sezione Regole di recesso in Impostazioni. Dashboard: pagina Recessi (registro legale read-only). NavMenu: Recessi/Impostazioni/Esclusioni. Scope: +write_returns,+write_orders. Editor email vincolato (oggetto/intro/nota + anteprima). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mv83a29B4eFv5ixoj6PoE1
This commit is contained in:
42
TEST-CHECKLIST.md
Normal file
42
TEST-CHECKLIST.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Test checklist - Notifica merchant + Tag ordine (+ Resi Shopify)
|
||||
|
||||
Da eseguire dopo lo sviluppo di questi comportamenti.
|
||||
|
||||
## 1. Riavvia dev (Prisma + nuovo scope write_orders cambiati)
|
||||
```
|
||||
q
|
||||
shopify app dev --tunnel-url https://miscellaneous-connections-harvest-chronicle.trycloudflare.com:3458
|
||||
```
|
||||
|
||||
## 2. Ri-concedi lo scope write_orders
|
||||
Apri l'app nell'admin di pcrt-reso-test -> approva il nuovo permesso (ordini).
|
||||
Se non lo chiede: disinstalla e reinstalla l'app.
|
||||
Verifica scope concessi:
|
||||
```
|
||||
docker exec recesso-pg psql -U postgres -d recesso -c "SELECT scope FROM \"Session\";"
|
||||
```
|
||||
Atteso: read_orders,read_products,write_returns,write_orders
|
||||
|
||||
## 3. Configura in Admin -> Impostazioni
|
||||
- Attiva "Invia email di notifica a ogni recesso"
|
||||
- Metti un'email in "Email notifiche"
|
||||
- Attiva "Aggiungi il tag 'Recesso' all'ordine"
|
||||
- Salva
|
||||
|
||||
## 4. Esegui recesso dallo storefront
|
||||
- Una volta su ordine EVASO
|
||||
- Una volta su ordine NON evaso
|
||||
|
||||
## 5. Verifica
|
||||
- Mailpit (http://localhost:18025): 2 email -> ricevuta cliente + notifica merchant
|
||||
- Ordine (Shopify admin): tag "Recesso" presente (filtrabile in lista ordini)
|
||||
- Ordine evaso: Reso creato (Ordini -> apri ordine -> blocco Reso)
|
||||
- Audit:
|
||||
```
|
||||
docker exec recesso-pg psql -U postgres -d recesso -c "SELECT event, LEFT(detail,60) as detail, \"createdAt\" FROM \"AuditLog\" ORDER BY \"createdAt\" DESC LIMIT 10;"
|
||||
```
|
||||
Attesi: order_tagged, merchant_notified, shopify_return_created (evaso) / shopify_return_skipped (non evaso)
|
||||
|
||||
## Note
|
||||
- I toggle in Impostazioni disattivano singolarmente notifica email e tag.
|
||||
- Il recesso legale (record + ricevuta cliente) e' indipendente: resta valido anche se tag/notifica/reso falliscono.
|
||||
Reference in New Issue
Block a user