Repository navigation
Closed
Labels
Description
Add Webhook Delivery module
Goal
Add an internal API module that can create, persist and retrieve
WebhookDelivery records using the types introduced in #173
This establishes the persistence layer without changing existing webhook
dispatch behaviour.
Proposed solution
Create apps/api/src/modules/WebhookDelivery.ts containing a
WebhookDeliveryModule.
The module should initially support:
- Creating and persisting a
WebhookDelivery. - Retrieving a
WebhookDeliveryby ID. - Returning
nullwhen a delivery does not exist.
New deliveries should:
- Use a generated ID with the
whd_zprefix. - Reference one Event and one Webhook Endpoint.
- Start with
pendingstatus. - Have
delivered_atandclaim_untilset tonull. - Have an empty
attemptsarray. - Set
next_attempt_atso the initial attempt is eligible for processing.
Add WebhookDeliveries to the collections initialized by
Database.EnsureCollections().
Follow the structure and dependency-injection patterns used by existing API
modules.
Expected files
apps/api/src/modules/WebhookDelivery.tsapps/api/src/__tests__/WebhookDelivery.spec.tsapps/api/src/modules/Database.ts
Acceptance criteria
WebhookDeliveryModulecan create and persist a delivery.- Created deliveries use the
whd_zID prefix. - Created deliveries contain the expected initial values.
- The module can retrieve a persisted delivery by ID.
- Retrieving an unknown ID returns
null. - The
WebhookDeliveriescollection is initialized with other known
collections. - Focused tests cover creation, retrieval and missing deliveries.
npx nx test apipasses.
Non-goals
- Creating or recording delivery attempts
- Delivery state transitions
- Integration with
EventServiceorWebhookDispatcher - Retry processing
- Scheduler routes
- Public API endpoints or request schemas
Activity
Benzilla commentedon Sep 30, 2026
Closed by #175