Add Webhook Database Schema
Add database models to support webhook configuration per integration, execution history tracking, and user permissions for triggering integrations.
- WebhookConfiguration: one-to-one with Integration; fields: webhookUrl (required), authToken (required, encrypted), enabled (default: false), audit fields
- WebhookExecutionLog: id (UUID), integrationId, triggeredBy, triggeredAt, eventId (nullable), requestPayload (JSON), responseStatusCode, responseBody (JSON), errorMessage, executionDurationMs
- Add
canTriggerIntegrationsboolean to User model (default: false); Admin/Super Admin users default to true
Example:
WebhookConfiguration record:
{
"integrationId": 123,
"webhookUrl": "https://integration-platform.example.com/webhooks/adp-sync",
"authToken": "[encrypted]",
"enabled": true,
"createdBy": 1,
"updatedBy": 1
}
WebhookExecutionLog record (with event context):
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"integrationId": 123,
"triggeredBy": 5,
"triggeredAt": "2025-11-06T15:30:00Z",
"eventId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"requestPayload": {
"employee_id": "12345",
"action": "sync"
},
"responseStatusCode": 200,
"responseBody": {"status": "success", "jobId": "abc123"},
"executionDurationMs": 245
}