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:
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "WithdrawalRequest" ADD COLUMN "shopifyReturnId" TEXT;
|
||||
@@ -0,0 +1,4 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Settings" ADD COLUMN "notifyEmail" TEXT,
|
||||
ADD COLUMN "notifyEnabled" BOOLEAN NOT NULL DEFAULT true,
|
||||
ADD COLUMN "tagEnabled" BOOLEAN NOT NULL DEFAULT true;
|
||||
@@ -0,0 +1,3 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Settings" ADD COLUMN "enforceExclusions" BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN "enforceWindow" BOOLEAN NOT NULL DEFAULT false;
|
||||
@@ -52,6 +52,11 @@ model Settings {
|
||||
emailSubject String?
|
||||
emailIntro String?
|
||||
emailNote String?
|
||||
notifyEnabled Boolean @default(true)
|
||||
notifyEmail String?
|
||||
tagEnabled Boolean @default(true)
|
||||
enforceWindow Boolean @default(false)
|
||||
enforceExclusions Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@ -87,6 +92,7 @@ model WithdrawalRequest {
|
||||
status WithdrawalStatus @default(RECEIVED)
|
||||
receiptSentAt DateTime?
|
||||
computedDeadline DateTime?
|
||||
shopifyReturnId String? // GID del Reso Shopify creato (se ordine evaso)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user