fix: Add app/frontend integration tests for the OpenAPI-generated client (#282)#377
Open
Bug-Hunter-X wants to merge 1 commit into
Open
Conversation
Contributor
|
👋 Thanks for the contribution! This PR came from a fork and the CI workflows were never auto-triggered (a GitHub Actions safety requirement for cross-repo PRs). To unblock this for merging, a maintainer needs to either:
Once the CI checks pass, I'll be able to merge this. 🚀 |
Contributor
|
👋 Thanks for the contribution! This PR contains code/test changes and CI workflows were never auto-triggered (a GitHub Actions safety requirement for cross-repo forks). To unblock this for merging, a maintainer needs to either:\n\n1. Manually click 'Approve and run workflows' on this PR's Actions tab via the GitHub UI, or\n2. Approve the pending CI on the PR checks page.\n\nOnce the CI checks pass, this can be merged. 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[npm run lint ✅ completed (existing repo warnings only)
npm run typecheck ✅ passed
npm test -- src/config/tests/config.test.ts --runInBand ✅ passed (9/9)
npm run build ✅ passed]
pr to be on main upstream not my fork
Overview
This PR adds a webhook event dispatch system to
apps/apiso merchant systems can be notified when payment lifecycle events occur. It introduces support forpayment.created,payment.detected,payment.confirmed, andpayment.failed, and sends a standardized JSON payload containing the event type, data object, and timestamp.Related Issue
Closes #282
Changes
⚙️ Webhook Dispatch System
[ADD]
apps/api/src/webhooks/webhooks.service.tsAdded the core webhook dispatch service for payment lifecycle events.
Implemented support for
payment.created,payment.detected,payment.confirmed, andpayment.failed.Standardized the payload format to include
event,data, andtimestamp.Added JSON POST delivery with a configurable timeout.
Added optional HMAC SHA-256 signing for webhook endpoints with a shared secret.
[ADD]
apps/api/src/webhooks/interfaces/webhook-event.interface.tsDefined the supported webhook event types.
Added shared interfaces for webhook payloads, endpoints, and delivery results.
[ADD]
apps/api/src/webhooks/interfaces/dispatch-webhook.interface.tsAdded request and response interfaces for webhook dispatch operations.
🌐 Webhook API Surface
[ADD]
apps/api/src/webhooks/webhooks.controller.tsAdded a public
POST /webhooks/dispatchendpoint to trigger webhook dispatch.Accepts a standardized event, payload data, and one or more target endpoints.
[ADD]
apps/api/src/webhooks/webhooks.module.tsAdded a dedicated NestJS module for webhook dispatch.
Exported the webhook service for reuse by future payment lifecycle code.
[MODIFY]
apps/api/src/app.module.tsRegistered the new
WebhooksModulein the API app.🧪 Tests
apps/api/src/webhooks/webhooks.service.spec.ts🔧 Configuration
apps/api/.env.exampleWEBHOOK_TIMEOUT_MSto configure webhook request timeouts.Verification Results
payment.createdeventpayment.detectedeventpayment.confirmedeventpayment.failedeventevent,data, andtimestamp