Issue:
[FEATURE] Schedule webhook for retry

## Description

Refactor webhooks core to add retry logic in webhooks core.


Currently, we store information about whether we have sent a webhook or not, improving on this we can implement retry logic to make this more reliable

Resolution:
<think>
PR Context:
- Title: feat(webhooks): implement automatic retries for failed webhook deliveries using scheduler
- Merged: 2024-03-04T06:45:46Z
- Files changed: 27 files
- Commits: 30 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
This PR adds support for automatically retrying outgoing webhook deliveries in case of failed deliveries, with the aid of the scheduler (process tracker).

### Behavior (Initial Delivery)

The behavior when an outgoing webhook is being sen
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(webhooks): implement automatic retries for failed webhook deliveries using scheduler (#3842)
Files to modify:


**crates/api_models/src/webhooks.rs**
  Modify existing code

**crates/diesel_models/src/process_tracker.rs**
  Modify existing code

**crates/diesel_models/src/query/events.rs**
  Add:
    - function: pub::find_by_event_id

**crates/router/src/bin/scheduler.rs**
  Modify existing code

**crates/router/src/compatibility/wrap.rs**
  Modify existing code

**crates/router/src/core/errors.rs**
  Modify existing code

**crates/router/src/core/payment_link.rs**
  Modify existing code

**crates/router/src/core/payment_methods/vault.rs**
  Modify existing code

**crates/router/src/core/refunds.rs**
  Remove:
    - function: pub::retry_refund_sync_task

**crates/router/src/core/webhooks.rs**
  Modify existing code

**crates/router/src/core/webhooks/types.rs**
  Add:
    - struct: pub::OutgoingWebhookTrackingData
    - enum: pub::WebhookDeliveryAttempt

**crates/router/src/db/events.rs**
  Add:
    - function: private::find_event_by_event_id
    - function: private::find_event_by_event_id

**crates/router/src/db/kafka_store.rs**
  Add:
    - function: private::find_event_by_event_id

**crates/router/src/events/outgoing_webhook_logs.rs**
  Modify existing code

**crates/router/src/routes/disputes.rs**
  Modify existing code

**crates/router/src/routes/metrics.rs**
  Modify existing code

**crates/router/src/routes/metrics/request.rs**
  Modify existing code

**crates/router/src/services/api.rs**
  Modify existing code

**crates/router/src/utils.rs**
  Modify existing code

**crates/router/src/workflows.rs**
  Add:
    - mod: pub::outgoing_webhook_retry

**crates/router/src/workflows/outgoing_webhook_retry.rs**
  Add:
    - function: private::execute_workflow
    - function: private::error_handler
    - function: pub::get_webhook_delivery_retry_schedule_time
    - function: pub::retry_webhook_delivery_task
    - function: private::get_outgoing_webhook_content_and_event_type
    - struct: pub::OutgoingWebhookRetryWorkflow
    - impl: impl ProcessTrackerWorkflow<AppState> for OutgoingWebhookRetryWorkflow

**crates/router/src/workflows/payment_sync.rs**
  Modify existing code

**crates/scheduler/src/consumer/types/process_data.rs**
  Add:
    - function: private::default
    - struct: pub::OutgoingWebhookRetryProcessTrackerMapping
    - impl: impl Default for OutgoingWebhookRetryProcessTrackerMapping

**crates/scheduler/src/db/queue.rs**
  Modify existing code

**crates/scheduler/src/errors.rs**
  Modify existing code

**crates/scheduler/src/utils.rs**
  Add:
    - function: private::test_get_delay
    - mod: private::tests