Bug: [FIX] Add Limit Parameter to User Role List for Org Function



### Feature Description

Description: The function [generic_user_roles_list_for_org_and_extra](https://github.com/juspay/hyperswitch/blob/a94cf25bb6eb40fafc5327aceffac8292b47b001/crates/diesel_models/src/query/user_role.rs#L270) currently fetches all roles for a give organisation and additional parameters. To improve performance and allow better control over data retrieval, we need to add a limit parameter to restrict the number of results returned.
```
pub async fn generic_user_roles_list_for_org_and_extra(
        conn: &PgPooledConn,
        user_id: Option<String>,
        org_id: id_type::OrganizationId,
        merchant_id: Option<id_type::MerchantId>,
        profile_id: Option<id_type::ProfileId>,
        version: Option<UserRoleVersion>,
    ) -> StorageResult<Vec<Self>> 
```

Task:
- Modify the existing function generic_user_roles_list_for_org_and_extra to include an optional limit parameter (Option<u32>).
- Pass this limit parameter down to the database query to restrict the number of user roles returned.
- Ensure the limit parameter is optional, and when it's not provided, the function should return all results as it currently does.


### Possible Implementation

- Add an additional parameter limit: `Option<type>` to the function signature of `generic_user_roles_list_for_org_and_extra`
- Modify the query logic to apply the limit if it is provided.
- Ensure the modified function still works with existing code that doesn't use the limit parameter. ( For older implementations, where this function is getting called, pass limit as `None` so that it doesn't change expected behaviour)

Additional Context: This change is analogous to the `generic_user_roles_list_for_user` function, which already includes a limit parameter. You can refer to that function’s implementation for guidance.

### How to Test
For testing, we can check where this `generic_user_roles_list_for_user` is used, currently this function is invoked from db function `list_user_roles_by_user_id` and this function is getting called from many core function, like `list_merchants_for_user_in_org` , `list_orgs_for_user`.

We can hit `user/list/merchants` api to invoke this `list_merchants_for_user_in_org` core function:

Signup:
```
curl --location 'http://localhost:8080/user/signup' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
    "email": "email1@gmail.com",
    "password": "Pass@123"
}'
```
Response:
```
{
    "token": "JWT",
    "token_type": "totp"
}
```
We will get intermediate token for setting up 2FA, it is skippable:
Skip 2FA, we will be getting a login token:
```
curl --location 'http://localhost:8080/user/2fa/terminate?skip_two_factor_auth=true' \
--header 'Authorization: Bearer Intermediate_Token'
```
```
{
    "token": "JWT",
    "token_type": "user_info"
}
```
It depicts successful signup, default one merchant_id has been created. (Baisically one org, with one merchant and one profile)
Now we can call `list/merchant`:
```
curl --location 'http://localhost:8080/user/list/merchant' \
--header 'Authorization: Bearer LOGIN_JWT'
```
Response:
```
[
    {
        "merchant_id": "merchant_test"
        "merchant_name": null
    }
]
```
We can create more merchant accounts:
```
curl --location 'http://localhost:8080/user/create_merchant' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer LoginJWT' \
--data '{
    "company_name": "hyperswitch"
}'
```
And if we try got get list it now, it will show more merchant_ids in list. Limit parameter in the function that controls how much data we need for our use case, say, sometimes we only want to get first one from list, we can just pass limit one instead of fetching whole list.

Acceptance Criteria:
- The function should accept an optional limit parameter.
- When a limit is provided, the number of results returned by the query should not exceed the limit.
- Tests the behaviour with and without the limit parameter.

### Have you spent some time checking if this feature request has been raised before?

- [X] I checked and didn't find a similar issue

### Submission Process:
- Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself.
- Once assigned, submit a pull request (PR).
- Maintainers will review and provide feedback, if any. 
- Maintainers can unassign issues due to inactivity, [read more here](https://github.com/juspay/hyperswitch/wiki/Hacktoberfest-Contribution-Rules).

Refer [here](https://github.com/juspay/hyperswitch/blob/main/docs/TERMS_OF_CONTEST.md) for Terms and conditions for the contest.
diff --git a/crates/diesel_models/src/query/user_role.rs b/crates/diesel_models/src/query/user_role.rs
index 5ef09715211..2496d22447e 100644
--- a/crates/diesel_models/src/query/user_role.rs
+++ b/crates/diesel_models/src/query/user_role.rs
@@ -258,6 +258,7 @@ impl UserRole {
         merchant_id: Option<id_type::MerchantId>,
         profile_id: Option<id_type::ProfileId>,
         version: Option<UserRoleVersion>,
+        limit: Option<u32>,
     ) -> StorageResult<Vec<Self>> {
         let mut query = <Self as HasTable>::table()
             .filter(dsl::org_id.eq(org_id))
@@ -279,6 +280,10 @@ impl UserRole {
             query = query.filter(dsl::version.eq(version));
         }
 
+        if let Some(limit) = limit {
+            query = query.limit(limit.into());
+        }
+
         router_env::logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
 
         match generics::db_metrics::track_database_call::<Self, _, _>(
diff --git a/crates/router/src/core/user_role.rs b/crates/router/src/core/user_role.rs
index 2cd715ac357..1d188168e5c 100644
--- a/crates/router/src/core/user_role.rs
+++ b/crates/router/src/core/user_role.rs
@@ -614,6 +614,7 @@ pub async fn list_users_in_lineage(
                     merchant_id: None,
                     profile_id: None,
                     version: None,
+                    limit: None,
                 },
                 request.entity_type,
             )
@@ -628,6 +629,7 @@ pub async fn list_users_in_lineage(
                     merchant_id: Some(&user_from_token.merchant_id),
                     profile_id: None,
                     version: None,
+                    limit: None,
                 },
                 request.entity_type,
             )
@@ -646,6 +648,7 @@ pub async fn list_users_in_lineage(
                     merchant_id: Some(&user_from_token.merchant_id),
                     profile_id: Some(profile_id),
                     version: None,
+                    limit: None,
                 },
                 request.entity_type,
             )
diff --git a/crates/router/src/db/user_role.rs b/crates/router/src/db/user_role.rs
index b589d375975..1fa70afa73f 100644
--- a/crates/router/src/db/user_role.rs
+++ b/crates/router/src/db/user_role.rs
@@ -19,6 +19,7 @@ pub struct ListUserRolesByOrgIdPayload<'a> {
     pub merchant_id: Option<&'a id_type::MerchantId>,
     pub profile_id: Option<&'a id_type::ProfileId>,
     pub version: Option<enums::UserRoleVersion>,
+    pub limit: Option<u32>,
 }
 
 pub struct ListUserRolesByUserIdPayload<'a> {
@@ -193,6 +194,7 @@ impl UserRoleInterface for Store {
             payload.merchant_id.cloned(),
             payload.profile_id.cloned(),
             payload.version,
+            payload.limit,
         )
         .await
         .map_err(|error| report!(errors::StorageError::from(error)))

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

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

## Description
<!-- Describe your changes in detail -->
This PR adds the `limit` parameter to the `generic_user_roles_list_for_org_and_extra` function.

### 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).
-->
Fixes #5917


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->

When having 5a1d2b3633e4fc8862f61bed9b5810eac2a313cb in:
```shell
curl 'http://localhost:8080/user/user/v2/list' \
  -H 'authorization: Bearer JWT' \
```
yields
```
[{"email":"email1@gmail.com","roles":[{"role_id":"org_admin","role_name":"organization_admin"}]}]
```

**Outdated** by 5a1d2b3633e4fc8862f61bed9b5810eac2a313cb:

Both _queries_
```shell
curl 'http://localhost:8080/user/user/v2/list' \
  -H 'authorization: Bearer JWT' \
```
```shell
curl 'http://localhost:8080/user/user/v2/list?limit=10' \
  -H 'authorization: Bearer JWT' \
```
yield:
```
[{"email":"email1@gmail.com","roles":[{"role_id":"org_admin","role_name":"organization_admin"}]}]
```

The _query_
```shell
curl 'http://localhost:8080/user/user/v2/list?limit=0' \
  -H 'authorization: Bearer JWT' \
```
yields:
```
[]
```

The _query_
```shell
curl 'http://localhost:8080/user/user/v2/list?limit=-10' \
  -H 'authorization: Bearer JWT' \
```
errors with:
```
Query deserialize error: invalid digit found in string
```

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

- [ ] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
