Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

04 - Information Architecture (Webhooks Module)

Screens, routes, data entities and cross-references. The module owns two documents: webhooks (subscriptions) and webhook_delivery_logs (attempts). Read alongside 00-shared/05 (global IA).


1. IA map

Settings / Developer tools (web-first admin)
└── Webhooks                     (/webhooks)                  S1
    ├── Create webhook           (/webhooks/new)              S2
    ├── Webhook detail           (/webhooks/:id)              S3
    │   ├── Edit                 (/webhooks/:id/edit)         S4
    │   ├── Delivery logs        (/webhooks/:id/logs)         S5
    │   │   └── Log detail       (bottom sheet)               S6
    │   ├── Test delivery        (dialog)                     S7
    │   └── Retry delivery       (dialog)                     S8
    └── Pause / Resume           (inline action)              S9

All routes are client-side; the API is flat at /api/v1/webhooks* (webhooks.controller.ts:16-17).

2. Information entities

2.1 Webhook (webhooks collection, webhook.schema.ts:8-30)

FieldTypeSource
namestring, requiredwebhook.schema.ts:10-11
urlstring, required (HTTPS expected)webhook.schema.ts:13-14
eventsstring[], default []webhook.schema.ts:16-17
secretstring, requiredwebhook.schema.ts:19-20
enabledboolean, default truewebhook.schema.ts:22-23
lastTriggeredAtDate (unused - never written)webhook.schema.ts:25-26
failureCountnumber, default 0 (unused - never written)webhook.schema.ts:28-29
tenantId, isDeleted, version, createdAt, updatedAtinheritedbase.schema.ts:10-34

2.2 WebhookDeliveryLog (webhook_delivery_logs collection, webhook-delivery-log.schema.ts:7-39)

FieldTypeSource
webhookIdObjectId ref Webhookwebhook-delivery-log.schema.ts:9-10
eventTypestring, required:12-13
payloadobject (raw event payload):15-16
statusenum pending / success / failed, default pending:18-23
responseCodenumber:25-26
responseBodystring:28-29
attemptCountnumber, default 0 (never incremented):31-32
attemptedAtDate, default now:34-35
completedAtDate:37-38

2.3 Domain events (the events picker vocabulary)

Event types are free-form strings on the wire (create-webhook.dto.ts:20-24); the client-side picker vocabulary is the set of emitted events. Representative registry: event-queue-map.ts:6-43 - UserRegistered, UserLoggedIn, PasswordResetRequested, UserCreated/Updated/Deleted, OrganizationCreated, AttendanceMarked/Updated, HomeworkCreated/Updated/Submitted/Graded/Deleted, ExamResultsPublished, StudentCreated/Updated/Deleted, TeacherCreated/Updated/Deleted, StaffCreated/Updated/Deleted, ParentCreated/Updated/Deleted, FeeStructureCreated, InvoiceIssued, PaymentCompleted. Plus the synthetic test event WebhookTested (webhooks.service.ts:134).

Event envelope (what the receiver gets): { eventType, tenantId, actorId, occurredAt, correlationId, payload } (domain-event.interface.ts:1-8).

3. Cross-references

EntityReferenced byRef
WebhookWebhookDeliveryLog.webhookIdwebhook-delivery-log.schema.ts:9-10
EventBus (any event)WebhooksService.onAnywebhooks.service.ts:26-28
webhook-deliver queueWebhooksModule + workerqueue.constants.ts:14, webhooks.module.ts:22, webhook-delivery.worker.ts:9
Event nameseventQueueMapevent-queue-map.ts:6-43

4. Navigation rules

  • S3 is the hub: metrics tile, recent logs preview, actions (edit, test, pause/resume).
  • S5 is reachable from S3 and from any "failed" badge deep link.
  • Pause/resume and test/retry never require leaving the current screen (dialogs).
  • Permission gating: webhook.create (S2), webhook.update (S4, S7, S8, S9), webhook.read (S1, S3, S5, S6) - permissions.constants.ts:89-92.
  • (planned) future: inbound public receiver under public scope (IMPLEMENTATION_PLAN.md:48); not in this IA.