## ST-3.3 Documentation (3 SP) - Add 11 page specification files documenting 25 pages - Create docs/05-frontend/pages/ directory - Specs: Goals, MLM, Portfolio, RBAC, Notifications, Analytics, Audit, Storage, Webhooks, Settings - Add _INDEX.md with complete listing ## ST-3.4 Dead Code Analysis (1 SP) - Analyze usePortfolio hook usage (18/21 functions used) - Document components ready for future use - Decision: Keep all code as preparation for features - Create DEAD-CODE-REPORT.md ## Frontend Submodule - WCAG improvements (11 files) - 160 unit tests (8 new test files) Sprint 3 (P2) completed: 14 SP Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.0 KiB
3.0 KiB
Webhooks Page Specification
Modulo: webhooks Ultima actualizacion: 2026-02-03 Total Paginas: 1
WebhooksPage
Ruta: /dashboard/webhooks
Archivo: src/pages/dashboard/WebhooksPage.tsx
Descripcion
Configuracion de webhooks outbound. Permite crear endpoints que reciben notificaciones de eventos del sistema.
Componentes Utilizados
- WebhookCard - Tarjeta de webhook con estado
- WebhookForm - Formulario de creacion/edicion
- WebhookDeliveryList - Lista de entregas recientes
- EventSelector - Selector de eventos a escuchar
Hooks Utilizados
useWebhooks()- Lista webhooksuseCreateWebhook()- Crea webhookuseUpdateWebhook()- Actualiza webhookuseDeleteWebhook()- Elimina webhookuseWebhookDeliveries(webhookId)- Lista entregasuseRetryDelivery()- Reintenta entrega fallidauseTestWebhook()- Envia test
Funcionalidades
- Crear nuevo webhook con URL y eventos
- Configurar headers custom (ej: Authorization)
- Ver estado (active/paused)
- Ver historial de entregas con status
- Reintentar entregas fallidas
- Enviar evento de test
- Ver secreto para validar firma
- Editar y eliminar webhooks
Eventos Disponibles
| Evento | Descripcion |
|---|---|
| user.created | Usuario creado |
| user.updated | Usuario actualizado |
| user.deleted | Usuario eliminado |
| subscription.created | Suscripcion creada |
| subscription.updated | Suscripcion actualizada |
| subscription.cancelled | Suscripcion cancelada |
| invoice.paid | Factura pagada |
| invoice.failed | Pago fallido |
Estados
- Loading: Spinner en lista
- Success: Lista de webhooks
- Empty: Mensaje "No webhooks configured"
- Delivery Success: Badge verde
- Delivery Failed: Badge rojo con retry
Acciones del Usuario
| Accion | Resultado |
|---|---|
| Click "Create Webhook" | Abre formulario |
| Submit formulario | Crea webhook |
| Click "Edit" | Abre edicion |
| Click "Delete" | Confirm + elimina |
| Click "Test" | Envia evento test |
| Click "Retry" en delivery | Reintenta envio |
| Toggle active | Activa/pausa webhook |
Permisos Requeridos
webhooks:read- Ver webhooks y entregaswebhooks:write- Crear/editar webhookswebhooks:delete- Eliminar webhooks
Estructura de Entrega
interface WebhookDelivery {
id: string;
webhook_id: string;
event: string;
payload: Record<string, any>;
response_status?: number;
response_body?: string;
error?: string;
attempts: number;
delivered_at?: string;
created_at: string;
}
Seguridad
- Cada webhook tiene un
secretunico - Las entregas incluyen header
X-Webhook-Signaturecon HMAC-SHA256 - Los endpoints deben responder con 2xx en 30 segundos
- Reintentos automaticos: 3 intentos con backoff exponencial
Notas
- Los webhooks pausados no reciben eventos
- Las entregas fallidas se retienen por 7 dias
- El payload incluye
event,data,timestampywebhook_id
Documentacion generada - Template SaaS - 2026-02-03