Bug: bug(EVENT_VIEWER): connector events is missing a status code field



The status code is being always registered as `0` in clickhouse.

![Image](https://github.com/juspay/hyperswitch/assets/21202349/6c45e608-d976-453d-9594-0312c59abbb9)

It seems that we aren't setting the status code at all from the application...


we should be able to extract the status code via a simple snippet
```rs
let status_code = response
    .as_ref()
    .map(|i| i.map_or_else(|value| value.status_code, |value| value.status_code)).unwrap_or_default();
```
diff --git a/crates/router/src/events/connector_api_logs.rs b/crates/router/src/events/connector_api_logs.rs
index 871a7af0d77..45c05a3077f 100644
--- a/crates/router/src/events/connector_api_logs.rs
+++ b/crates/router/src/events/connector_api_logs.rs
@@ -18,6 +18,7 @@ pub struct ConnectorEvent {
     created_at: i128,
     request_id: String,
     latency: u128,
+    status_code: u16,
 }
 
 impl ConnectorEvent {
@@ -33,6 +34,7 @@ impl ConnectorEvent {
         merchant_id: String,
         request_id: Option<&RequestId>,
         latency: u128,
+        status_code: u16,
     ) -> Self {
         Self {
             connector_name,
@@ -52,6 +54,7 @@ impl ConnectorEvent {
                 .map(|i| i.as_hyphenated().to_string())
                 .unwrap_or("NO_REQUEST_ID".to_string()),
             latency,
+            status_code,
         }
     }
 }
diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs
index 307dff55071..7f69954a8f7 100644
--- a/crates/router/src/services/api.rs
+++ b/crates/router/src/services/api.rs
@@ -372,7 +372,13 @@ where
                     let response = call_connector_api(state, request).await;
                     let external_latency = current_time.elapsed().as_millis();
                     logger::debug!(connector_response=?response);
-
+                    let status_code = response
+                        .as_ref()
+                        .map(|i| {
+                            i.as_ref()
+                                .map_or_else(|value| value.status_code, |value| value.status_code)
+                        })
+                        .unwrap_or_default();
                     let connector_event = ConnectorEvent::new(
                         req.connector.clone(),
                         std::any::type_name::<T>(),
@@ -394,6 +400,7 @@ where
                         req.merchant_id.clone(),
                         state.request_id.as_ref(),
                         external_latency,
+                        status_code,
                     );
 
                     match connector_event.try_into() {

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
adding status code to connector Kafka events


### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?
f
do payment confirm call and then check for the status_code in log in loki  where ```topic=hyperswitch-outgoing-connector-events```

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
