Piattaforma ITI TECHNOLOGY: monorepo, Medusa, API, sito, area riservata e deploy
Deploy stack su Proxmox / deploy (push) Failing after 3s
Deploy stack su Proxmox / deploy (push) Failing after 3s
Monorepo npm con apps/public (Angular SSR), apps/private (Angular SPA), apps/api (Fastify), packages/shared e packages/styles; Medusa 2.21 in medusa/; infrastruttura Docker (Postgres PostGIS+pgvector, Redis, Caddy, backup) e workflow Gitea Actions per il deploy via SSH a ogni push su master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018jQyT6dR9czzGwqb7FkG6u
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# 07 — Medusa: subscriber che notificano Fastify
|
||||
|
||||
Leggi `CLAUDE.md`.
|
||||
|
||||
## Obiettivo
|
||||
Inviare a Fastify gli eventi rilevanti dell'e-commerce.
|
||||
|
||||
## Cosa fare
|
||||
- Subscriber in `medusa/src/subscribers/` per `order.placed`, `order.canceled`, `order.fulfillment_created` (verifica i nomi esatti degli eventi in Medusa v2).
|
||||
- Ogni subscriber fa `POST {FASTIFY_WEBHOOK_URL}/webhooks/medusa` con body `{ id, event, occurred_at, data }` dove `id` è un UUID univoco dell'evento.
|
||||
- Firma HMAC-SHA256 del body con `WEBHOOK_SECRET` nell'header `x-signature`.
|
||||
- Retry con backoff (max 5 tentativi) se Fastify non risponde 2xx; errori loggati, mai bloccanti per l'ordine.
|
||||
|
||||
## Criteri di accettazione
|
||||
- Piazzando un ordine di test, viene inviata una richiesta firmata all'URL configurato (verificabile con un endpoint di test o log).
|
||||
- Se l'endpoint è giù, l'ordine si completa comunque e i retry sono visibili nei log.
|
||||
- `CLAUDE.md` aggiornato con formato payload e schema di firma.
|
||||
Reference in New Issue
Block a user